Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/index.js
  • Loading branch information
alexander-akait committed Oct 13, 2020
2 parents e3a1213 + fc1ed55 commit 5aba211
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [4.0.0-rc.4](https://github.com/postcss-modules-local-by-default/compare/v4.0.0-rc.4...v4.0.0) - 2020-10-13

### Fixes

- compatibility with plugins other plugins

## [4.0.0-rc.4](https://github.com/postcss-modules-local-by-default/compare/v4.0.0-rc.3...v4.0.0-rc.4) - 2020-10-11

### Fixes
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postcss-modules-local-by-default",
"version": "4.0.0-rc.4",
"version": "4.0.0",
"description": "A CSS Modules transform to make local scope the default",
"main": "src/index.js",
"author": "Mark Dalgleish",
Expand Down Expand Up @@ -33,7 +33,7 @@
"prepublishOnly": "yarn test"
},
"dependencies": {
"icss-utils": "^5.0.0-rc.0",
"icss-utils": "^5.0.0",
"postcss-selector-parser": "^6.0.2",
"postcss-value-parser": "^4.1.0"
},
Expand Down
8 changes: 5 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,8 @@ function localizeDeclaration(declaration, context) {

module.exports = (options = {}) => {
if (
options &&
options.mode &&
options.mode !== "global" &&
options.mode !== "local" &&
options.mode !== "pure"
Expand All @@ -430,16 +432,16 @@ module.exports = (options = {}) => {
);
}

const pureMode = options.mode === "pure";
const globalMode = options.mode === "global";
const pureMode = options && options.mode === "pure";
const globalMode = options && options.mode === "global";

return {
postcssPlugin: "postcss-modules-local-by-default",
prepare() {
const localAliasMap = new Map();

return {
OnceExit(root) {
Once(root) {
const { icssImports } = extractICSS(root, false);

Object.keys(icssImports).forEach((key) => {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1877,10 +1877,10 @@ iconv-lite@0.4.24:
dependencies:
safer-buffer ">= 2.1.2 < 3"

icss-utils@^5.0.0-rc.0:
version "5.0.0-rc.0"
resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.0.0-rc.0.tgz#c72082bd0edaa2cd85b25bfe98db2e49be8d4306"
integrity sha512-iTcLOd8eGcKQBusS3SRQYCK324r6Aov3GlfWRbRYC9oAp93v1qm7kBWB0WeEjZ3rGoOvymTkQUhOiTokNz9mKg==
icss-utils@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.0.0.tgz#03ed56c3accd32f9caaf1752ebf64ef12347bb84"
integrity sha512-aF2Cf/CkEZrI/vsu5WI/I+akFgdbwQHVE9YRZxATrhH4PVIe6a3BIjwjEcW+z+jP/hNh+YvM3lAAn1wJQ6opSg==

ignore@^4.0.6:
version "4.0.6"
Expand Down

0 comments on commit 5aba211

Please sign in to comment.