Skip to content

Commit 5aba211

Browse files
Merge remote-tracking branch 'origin/master'
# Conflicts: # src/index.js
2 parents e3a1213 + fc1ed55 commit 5aba211

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55

6+
## [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
7+
8+
### Fixes
9+
10+
- compatibility with plugins other plugins
11+
612
## [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
713

814
### Fixes

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postcss-modules-local-by-default",
3-
"version": "4.0.0-rc.4",
3+
"version": "4.0.0",
44
"description": "A CSS Modules transform to make local scope the default",
55
"main": "src/index.js",
66
"author": "Mark Dalgleish",
@@ -33,7 +33,7 @@
3333
"prepublishOnly": "yarn test"
3434
},
3535
"dependencies": {
36-
"icss-utils": "^5.0.0-rc.0",
36+
"icss-utils": "^5.0.0",
3737
"postcss-selector-parser": "^6.0.2",
3838
"postcss-value-parser": "^4.1.0"
3939
},

src/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,8 @@ function localizeDeclaration(declaration, context) {
421421

422422
module.exports = (options = {}) => {
423423
if (
424+
options &&
425+
options.mode &&
424426
options.mode !== "global" &&
425427
options.mode !== "local" &&
426428
options.mode !== "pure"
@@ -430,16 +432,16 @@ module.exports = (options = {}) => {
430432
);
431433
}
432434

433-
const pureMode = options.mode === "pure";
434-
const globalMode = options.mode === "global";
435+
const pureMode = options && options.mode === "pure";
436+
const globalMode = options && options.mode === "global";
435437

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

441443
return {
442-
OnceExit(root) {
444+
Once(root) {
443445
const { icssImports } = extractICSS(root, false);
444446

445447
Object.keys(icssImports).forEach((key) => {

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,10 +1877,10 @@ [email protected]:
18771877
dependencies:
18781878
safer-buffer ">= 2.1.2 < 3"
18791879

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

18851885
ignore@^4.0.6:
18861886
version "4.0.6"

0 commit comments

Comments
 (0)