diff --git a/CHANGELOG.md b/CHANGELOG.md index bd421b8..dd7bf90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/package.json b/package.json index ef86bd4..769c775 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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" }, diff --git a/src/index.js b/src/index.js index cd0cae7..cbd269e 100644 --- a/src/index.js +++ b/src/index.js @@ -421,6 +421,8 @@ function localizeDeclaration(declaration, context) { module.exports = (options = {}) => { if ( + options && + options.mode && options.mode !== "global" && options.mode !== "local" && options.mode !== "pure" @@ -430,8 +432,8 @@ 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", @@ -439,7 +441,7 @@ module.exports = (options = {}) => { const localAliasMap = new Map(); return { - OnceExit(root) { + Once(root) { const { icssImports } = extractICSS(root, false); Object.keys(icssImports).forEach((key) => { diff --git a/yarn.lock b/yarn.lock index 209edf5..0c1fd40 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"