diff --git a/.circleci/config.yml b/.circleci/config.yml
index 5f85c101..8a89efd4 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -50,6 +50,28 @@ jobs:
key: dependency-cache-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
+ analysis:
+ docker:
+ - image: webpackcontrib/circleci-node-base:latest
+ steps:
+ - checkout
+ - restore_cache:
+ key: dependency-cache-{{ checksum "package-lock.json" }}
+ - run:
+ name: Install Latest NPM.
+ command: npm i -g npm@latest
+ - run:
+ name: NPM Install.
+ command: npm ci
+ - run:
+ name: Run linting.
+ command: npm run lint
+ - run:
+ name: Run NPM Audit.
+ command: npm run security
+ - run:
+ name: Validate Commit Messages.
+ command: npm run ci:lint:commits
node6-latest:
docker:
- image: webpackcontrib/circleci-node6:latest
@@ -78,32 +100,10 @@ jobs:
name: Submit coverage data to codecov.
command: bash <(curl -s https://codecov.io/bash)
when: on_success
- node10-canary:
+ node6-canary:
docker:
- image: webpackcontrib/circleci-node10:latest
<<: *canary_tests
- analysis:
- docker:
- - image: webpackcontrib/circleci-node-base:latest
- steps:
- - checkout
- - restore_cache:
- key: dependency-cache-{{ checksum "package-lock.json" }}
- - run:
- name: Install Latest NPM.
- command: npm i -g npm@latest
- - run:
- name: NPM Install.
- command: npm ci
- - run:
- name: Run linting.
- command: npm run lint
- - run:
- name: Run NPM Audit.
- command: npm run security
- - run:
- name: Validate Commit Messages.
- command: npm run ci:lint:commits
workflows:
version: 2
@@ -136,10 +136,10 @@ workflows:
filters:
tags:
only: /.*/
- - node10-canary:
+ - node6-canary:
requires:
- analysis
- node6-latest
filters:
tags:
- only: /.*/
+ only: /.*/
\ No newline at end of file
diff --git a/.editorconfig b/.editorconfig
index 45946eaa..9f89f364 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -9,5 +9,5 @@ insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
-insert_final_newline = false
+insert_final_newline = true
trim_trailing_whitespace = false
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c12cbba8..7cd58a1e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,58 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+
+# [2.0.1](https://github.com/webpack-contrib/css-loader/compare/v2.0.0...v2.0.1) (2018-12-14)
+
+
+### Bug Fixes
+
+* safe checking if params are present for at rule ([#871](https://github.com/webpack-contrib/css-loader/issues/871)) ([a88fed1](https://github.com/webpack-contrib/css-loader/commit/a88fed1))
+* `getLocalIdent` now accepts `false` value ([#865](https://github.com/webpack-contrib/css-loader/issues/865)) ([1825e8a](https://github.com/webpack-contrib/css-loader/commit/1825e8a))
+
+
+
+
+# [2.0.0](https://github.com/webpack-contrib/css-loader/compare/v1.0.1...v2.0.0) (2018-12-07)
+
+
+### Bug Fixes
+
+* broken unucode characters ([#850](https://github.com/webpack-contrib/css-loader/issues/850)) ([f599c70](https://github.com/webpack-contrib/css-loader/commit/f599c70))
+* correctly processing `urls()` with `?#hash` ([#803](https://github.com/webpack-contrib/css-loader/issues/803)) ([417d105](https://github.com/webpack-contrib/css-loader/commit/417d105))
+* don't break loader on invalid or not exists url or import token ([#827](https://github.com/webpack-contrib/css-loader/issues/827)) ([9e52d26](https://github.com/webpack-contrib/css-loader/commit/9e52d26))
+* don't duplicate import with same media in different case ([#819](https://github.com/webpack-contrib/css-loader/issues/819)) ([9f66e33](https://github.com/webpack-contrib/css-loader/commit/9f66e33))
+* emit warnings on broken `import` at-rules ([#806](https://github.com/webpack-contrib/css-loader/issues/806)) ([4bdf08b](https://github.com/webpack-contrib/css-loader/commit/4bdf08b))
+* handle uppercase `URL` in `import` at-rules ([#818](https://github.com/webpack-contrib/css-loader/issues/818)) ([3ebdcd5](https://github.com/webpack-contrib/css-loader/commit/3ebdcd5))
+* inconsistent generate class names for css modules on difference os ([#812](https://github.com/webpack-contrib/css-loader/issues/812)) ([0bdf9b7](https://github.com/webpack-contrib/css-loader/commit/0bdf9b7))
+* reduce number of `require` for `urls()` ([#854](https://github.com/webpack-contrib/css-loader/issues/854)) ([3338656](https://github.com/webpack-contrib/css-loader/commit/3338656))
+* support deduplication of string module ids (optimization.namedModules) ([#789](https://github.com/webpack-contrib/css-loader/issues/789)) ([e3bb83a](https://github.com/webpack-contrib/css-loader/commit/e3bb83a))
+* support module resolution in `composes` ([#845](https://github.com/webpack-contrib/css-loader/issues/845)) ([453248f](https://github.com/webpack-contrib/css-loader/commit/453248f))
+* same `urls()` resolving logic for `modules` (`local` and `global`) and without modules ([#843](https://github.com/webpack-contrib/css-loader/issues/843)) ([fdcf687](https://github.com/webpack-contrib/css-loader/commit/fdcf687))
+
+### Features
+
+* allow to disable css modules and **disable their by default** ([#842](https://github.com/webpack-contrib/css-loader/issues/842)) ([889dc7f](https://github.com/webpack-contrib/css-loader/commit/889dc7f))
+* disable `import` option doesn't affect on `composes` ([#822](https://github.com/webpack-contrib/css-loader/issues/822)) ([f9aa73c](https://github.com/webpack-contrib/css-loader/commit/f9aa73c))
+* allow to filter `urls` ([#856](https://github.com/webpack-contrib/css-loader/issues/856)) ([5e702e7](https://github.com/webpack-contrib/css-loader/commit/5e702e7))
+* allow to filter `import` at-rules ([#857](https://github.com/webpack-contrib/css-loader/issues/857)) ([5e6034c](https://github.com/webpack-contrib/css-loader/commit/5e6034c))
+* emit warning on invalid `urls()` ([#832](https://github.com/webpack-contrib/css-loader/issues/832)) ([da95db8](https://github.com/webpack-contrib/css-loader/commit/da95db8))
+* added `exportOnlyLocals` option ([#824](https://github.com/webpack-contrib/css-loader/issues/824)) ([e9327c0](https://github.com/webpack-contrib/css-loader/commit/e9327c0))
+* reuse `postcss` ast from other loaders (i.e `postcss-loader`) ([#840](https://github.com/webpack-contrib/css-loader/issues/840)) ([1dad1fb](https://github.com/webpack-contrib/css-loader/commit/1dad1fb))
+* schema options ([b97d997](https://github.com/webpack-contrib/css-loader/commit/b97d997))
+
+
+### BREAKING CHANGES
+
+* resolving logic for `url()` and `import` at-rules works the same everywhere, it does not matter whether css modules are enabled (with `global` and `local` module) or not. Examples - `url('image.png')` as `require('./image.png')`, `url('./image.png')` as `require('./image.png')`, `url('~module/image.png')` as `require('module/image.png')`.
+* by default css modules are disabled (now `modules: false` disable all css modules features), you can return old behaviour change this on `modules: 'global'`
+* `css-loader/locals` was dropped in favor `exportOnlyLocals` option
+* `import` option only affect on `import` at-rules and doesn't affect on `composes` declarations
+* invalid `@import` at rules now emit warnings
+* use `postcss@7`
+
+
+
## [1.0.1](https://github.com/webpack-contrib/css-loader/compare/v1.0.0...v1.0.1) (2018-10-29)
diff --git a/README.md b/README.md
index 8d6885a8..ce9bae14 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,6 @@
-
CSS Loader
[![npm][npm]][npm-url]
@@ -661,17 +660,33 @@ module.exports = {
For production builds it's recommended to extract the CSS from your bundle being able to use parallel loading of CSS/JS resources later on.
This can be achieved by using the [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) to extract the CSS when running in production mode.
+## Contributing
+
+Please take a moment to read our contributing guidelines if you haven't yet done so.
+
+[CONTRIBUTING](./.github/CONTRIBUTING.md)
+
+## License
+
+[MIT](./LICENSE)
+
[npm]: https://img.shields.io/npm/v/css-loader.svg
[npm-url]: https://npmjs.com/package/css-loader
+
[node]: https://img.shields.io/node/v/css-loader.svg
[node-url]: https://nodejs.org
+
[deps]: https://david-dm.org/webpack-contrib/css-loader.svg
[deps-url]: https://david-dm.org/webpack-contrib/css-loader
+
[tests]: https://img.shields.io/circleci/project/github/webpack-contrib/css-loader.svg
[tests-url]: https://circleci.com/gh/webpack-contrib/css-loader
+
[cover]: https://codecov.io/gh/webpack-contrib/css-loader/branch/master/graph/badge.svg
[cover-url]: https://codecov.io/gh/webpack-contrib/css-loader
+
[chat]: https://badges.gitter.im/webpack/webpack.svg
[chat-url]: https://gitter.im/webpack/webpack
+
[size]: https://packagephobia.now.sh/badge?p=css-loader
[size-url]: https://packagephobia.now.sh/result?p=css-loader
diff --git a/appveyor.yml b/appveyor.yml
index 8498298b..4e2aeb95 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -9,20 +9,20 @@ cache:
- '%APPDATA%\npm-cache'
environment:
matrix:
- - nodejs_version: '11'
+ - nodejs_version: '6'
webpack_version: latest
job_part: test
- - nodejs_version: '10'
+ - nodejs_version: '8'
webpack_version: latest
job_part: test
- - nodejs_version: '8'
+ - nodejs_version: '10'
webpack_version: latest
job_part: test
- - nodejs_version: '6'
+ - nodejs_version: '11'
webpack_version: latest
job_part: test
- nodejs_version: '6'
- webpack_version: latest
+ webpack_version: next
job_part: next
build: 'off'
matrix:
@@ -35,8 +35,7 @@ install:
before_test:
- cmd: npm install webpack@%webpack_version%
test_script:
- - node --version
- node --version
- npm --version
- cmd: FOR /F %%I in ('compver --name webpack --gte %webpack_version% --lt latest') do SET COMPARED_VERSION_RESULT=%%I
- - cmd: IF %COMPARED_VERSION_RESULT% NEQ -1 (npm run ci:test) ELSE (ECHO "Next is older than Latest - Skipping Canary Suite")
+ - cmd: IF %COMPARED_VERSION_RESULT% NEQ -1 (npm run ci:%job_part%) ELSE (ECHO "Next is older than Latest - Skipping Canary Suite")
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index f3dd5fba..6379e782 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "css-loader",
- "version": "1.0.1",
+ "version": "2.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -399,9 +399,9 @@
},
"dependencies": {
"regexpu-core": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.3.0.tgz",
- "integrity": "sha512-pniBuFHJMDy9P8jnXGBvfLQsQqzGsZuhT0KezuTWn1vMdJxuhsHauNdIvzMsiORmYPgLbPGwWbq3czCKa5RsWA==",
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.4.0.tgz",
+ "integrity": "sha512-eDDWElbwwI3K0Lo6CqbQbA6FwgtCz4kYTarrri1okfkRLZAqstU+B3voZBCjg8Fl6iq0gXrJG6MvRgLthfvgOA==",
"dev": true,
"requires": {
"regenerate": "^1.4.0",
@@ -550,9 +550,9 @@
},
"dependencies": {
"regexpu-core": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.3.0.tgz",
- "integrity": "sha512-pniBuFHJMDy9P8jnXGBvfLQsQqzGsZuhT0KezuTWn1vMdJxuhsHauNdIvzMsiORmYPgLbPGwWbq3czCKa5RsWA==",
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.4.0.tgz",
+ "integrity": "sha512-eDDWElbwwI3K0Lo6CqbQbA6FwgtCz4kYTarrri1okfkRLZAqstU+B3voZBCjg8Fl6iq0gXrJG6MvRgLthfvgOA==",
"dev": true,
"requires": {
"regenerate": "^1.4.0",
@@ -766,9 +766,9 @@
},
"dependencies": {
"regexpu-core": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.3.0.tgz",
- "integrity": "sha512-pniBuFHJMDy9P8jnXGBvfLQsQqzGsZuhT0KezuTWn1vMdJxuhsHauNdIvzMsiORmYPgLbPGwWbq3czCKa5RsWA==",
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.4.0.tgz",
+ "integrity": "sha512-eDDWElbwwI3K0Lo6CqbQbA6FwgtCz4kYTarrri1okfkRLZAqstU+B3voZBCjg8Fl6iq0gXrJG6MvRgLthfvgOA==",
"dev": true,
"requires": {
"regenerate": "^1.4.0",
@@ -1371,6 +1371,19 @@
"@xtuc/long": "4.2.1"
}
},
+ "@webpack-contrib/defaults": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/@webpack-contrib/defaults/-/defaults-3.0.1.tgz",
+ "integrity": "sha512-UGDnd2KzmRpuj98KXr0Us1/HbGznrWclG2f0TXBfBBEr36AlrL+448YH9tkzr3O/BDdV/yD1Q/e7yW9Tsa/05g==",
+ "dev": true,
+ "requires": {
+ "chalk": "^2.3.0",
+ "git-username": "^1.0.0",
+ "mrm-core": "^3.1.1",
+ "path-exists": "^3.0.0",
+ "user-meta": "^1.0.0"
+ }
+ },
"@webpack-contrib/eslint-config-webpack": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@webpack-contrib/eslint-config-webpack/-/eslint-config-webpack-3.0.0.tgz",
@@ -1462,9 +1475,9 @@
}
},
"ajv-errors": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.0.tgz",
- "integrity": "sha1-7PAh+hCP0X37Xms4Py3SM+Mf/Fk="
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz",
+ "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ=="
},
"ajv-keywords": {
"version": "3.2.0",
@@ -1801,6 +1814,15 @@
"trim-right": "^1.0.1"
},
"dependencies": {
+ "detect-indent": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz",
+ "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=",
+ "dev": true,
+ "requires": {
+ "repeating": "^2.0.0"
+ }
+ },
"jsesc": {
"version": "1.3.0",
"resolved": "http://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz",
@@ -2203,7 +2225,7 @@
"dependencies": {
"resolve": {
"version": "1.1.7",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz",
+ "resolved": "http://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz",
"integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=",
"dev": true
}
@@ -2432,9 +2454,9 @@
}
},
"caniuse-lite": {
- "version": "1.0.30000914",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000914.tgz",
- "integrity": "sha512-qqj0CL1xANgg6iDOybiPTIxtsmAnfIky9mBC35qgWrnK4WwmhqfpmkDYMYgwXJ8LRZ3/2jXlCntulO8mBaAgSg==",
+ "version": "1.0.30000918",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000918.tgz",
+ "integrity": "sha512-CAZ9QXGViBvhHnmIHhsTPSWFBujDaelKnUj7wwImbyQRxmXynYqKGi3UaZTSz9MoVh+1EVxOS/DFIkrJYgR3aw==",
"dev": true
},
"capture-exit": {
@@ -3489,9 +3511,9 @@
}
},
"cssdb": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/cssdb/-/cssdb-4.2.0.tgz",
- "integrity": "sha512-27CuM+rp1/HIH4hkiOvrRUjgv31WamWk7+XSGz7OP/uWR8EOMeXOh4Ncpa/Eq1eO/1eRhQx7HWj8KEbt4nKQBA==",
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/cssdb/-/cssdb-4.3.0.tgz",
+ "integrity": "sha512-VHPES/+c9s+I0ryNj+PXvp84nz+ms843z/efpaEINwP/QfGsINL3gpLp5qjapzDNzNzbXxur8uxKxSXImrg4ag==",
"dev": true
},
"cssesc": {
@@ -3572,9 +3594,9 @@
}
},
"date-fns": {
- "version": "1.29.0",
- "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.29.0.tgz",
- "integrity": "sha512-lbTXWZ6M20cWH8N9S6afb0SBm6tMk+uUg6z3MqHPKE9atmsY3kJkTm8vKe93izJ2B2+q5MV990sM2CHgtAZaOw==",
+ "version": "1.30.1",
+ "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.30.1.tgz",
+ "integrity": "sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==",
"dev": true
},
"date-now": {
@@ -3934,13 +3956,10 @@
}
},
"detect-indent": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz",
- "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=",
- "dev": true,
- "requires": {
- "repeating": "^2.0.0"
- }
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz",
+ "integrity": "sha1-OHHMCmoALow+Wzz38zYmRnXwa50=",
+ "dev": true
},
"detect-newline": {
"version": "2.1.0",
@@ -4051,9 +4070,9 @@
}
},
"electron-to-chromium": {
- "version": "1.3.88",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.88.tgz",
- "integrity": "sha512-UPV4NuQMKeUh1S0OWRvwg0PI8ASHN9kBC8yDTk1ROXLC85W5GnhTRu/MZu3Teqx3JjlQYuckuHYXSUSgtb3J+A==",
+ "version": "1.3.90",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.90.tgz",
+ "integrity": "sha512-IjJZKRhFbWSOX1w0sdIXgp4CMRguu6UYcTckyFF/Gjtemsu/25eZ+RXwFlV+UWcIueHyQA1UnRJxocTpH5NdGA==",
"dev": true
},
"elegant-spinner": {
@@ -4171,9 +4190,9 @@
}
},
"eslint": {
- "version": "5.9.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.9.0.tgz",
- "integrity": "sha512-g4KWpPdqN0nth+goDNICNXGfJF7nNnepthp46CAlJoJtC5K/cLu3NgCM3AHu1CkJ5Hzt9V0Y0PBAO6Ay/gGb+w==",
+ "version": "5.10.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.10.0.tgz",
+ "integrity": "sha512-HpqzC+BHULKlnPwWae9MaVZ5AXJKpkxCVXQHrFaRw3hbDj26V/9ArYM4Rr/SQ8pi6qUPLXSSXC4RBJlyq2Z2OQ==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
@@ -4185,7 +4204,7 @@
"eslint-scope": "^4.0.0",
"eslint-utils": "^1.3.1",
"eslint-visitor-keys": "^1.0.0",
- "espree": "^4.0.0",
+ "espree": "^5.0.0",
"esquery": "^1.0.1",
"esutils": "^2.0.2",
"file-entry-cache": "^2.0.0",
@@ -4195,7 +4214,6 @@
"ignore": "^4.0.6",
"imurmurhash": "^0.1.4",
"inquirer": "^6.1.0",
- "is-resolvable": "^1.1.0",
"js-yaml": "^3.12.0",
"json-stable-stringify-without-jsonify": "^1.0.1",
"levn": "^0.3.0",
@@ -4387,9 +4405,9 @@
"dev": true
},
"espree": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/espree/-/espree-4.1.0.tgz",
- "integrity": "sha512-I5BycZW6FCVIub93TeVY1s7vjhP9CY6cXCznIRfiig7nRviKZYdRnj/sHEWC6A7WE9RDWOFq9+7OsWSYz8qv2w==",
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.0.tgz",
+ "integrity": "sha512-1MpUfwsdS9MMoN7ZXqAr9e9UKdVHDcvrJpyx7mm1WuQlx/ygErEQBzgi5Nh5qBHIoYweprhtMkTCb9GhcAIcsA==",
"dev": true,
"requires": {
"acorn": "^6.0.2",
@@ -4979,10 +4997,16 @@
"null-check": "^1.0.0"
}
},
+ "fs-exists-sync": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz",
+ "integrity": "sha1-mC1ok6+RjnLQjeyehnP/K1qNat0=",
+ "dev": true
+ },
"fs-extra": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz",
- "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==",
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz",
+ "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==",
"dev": true,
"requires": {
"graceful-fs": "^4.1.2",
@@ -5794,6 +5818,28 @@
"assert-plus": "^1.0.0"
}
},
+ "git-config-path": {
+ "version": "1.0.1",
+ "resolved": "http://registry.npmjs.org/git-config-path/-/git-config-path-1.0.1.tgz",
+ "integrity": "sha1-bTP37WPbDQ4RgTFQO6s6ykfVRmQ=",
+ "dev": true,
+ "requires": {
+ "extend-shallow": "^2.0.1",
+ "fs-exists-sync": "^0.1.0",
+ "homedir-polyfill": "^1.0.0"
+ },
+ "dependencies": {
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ }
+ }
+ },
"git-raw-commits": {
"version": "1.3.6",
"resolved": "http://registry.npmjs.org/git-raw-commits/-/git-raw-commits-1.3.6.tgz",
@@ -5886,12 +5932,13 @@
}
},
"git-username": {
- "version": "0.5.1",
- "resolved": "https://registry.npmjs.org/git-username/-/git-username-0.5.1.tgz",
- "integrity": "sha512-xjUjrj3i4kup2A3a/ZVZB1Nt0PUX7SU7KeVqIbXPdslT7NbNfyO04JMxBv4gar77JePdS+A6f05jG1Viy6+U1w==",
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/git-username/-/git-username-1.0.0.tgz",
+ "integrity": "sha512-xm45KwBR6Eu1jO4umx/o2M84v9TC7tdOBuzLx8ayhdR9H1FBiiG9azz31uC0esDvaWVBTDINpJ5USomk+ja8OQ==",
"dev": true,
"requires": {
- "remote-origin-url": "^0.4.0"
+ "parse-github-url": "^1.0.2",
+ "remote-origin-url": "^1.0.0"
}
},
"gitconfiglocal": {
@@ -6171,6 +6218,15 @@
"os-tmpdir": "^1.0.1"
}
},
+ "homedir-polyfill": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz",
+ "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=",
+ "dev": true,
+ "requires": {
+ "parse-passwd": "^1.0.0"
+ }
+ },
"hosted-git-info": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz",
@@ -6832,12 +6888,6 @@
"integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=",
"dev": true
},
- "is-resolvable": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz",
- "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==",
- "dev": true
- },
"is-retry-allowed": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz",
@@ -8922,33 +8972,78 @@
}
},
"mrm-core": {
- "version": "2.6.0",
- "resolved": "https://registry.npmjs.org/mrm-core/-/mrm-core-2.6.0.tgz",
- "integrity": "sha512-NRhdbwvEuAk2btF7se3SFFtDYw/RkWrEWf0z3dld1cDZzVEgfXn2iXG08nlhwgES8c0hxRsaOsgpuhp6z+Yq0Q==",
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/mrm-core/-/mrm-core-3.3.0.tgz",
+ "integrity": "sha512-3A7RAwRmAfVpUxQxxfvX5exQH9+pVGRUPM5ZRwQjCC5BTS8XkjjeOt1Svtc89idIpQGxRixbQ95jBRw8tjO2rw==",
"dev": true,
"requires": {
"babel-code-frame": "^6.26.0",
- "chalk": "^2.3.0",
"comment-json": "^1.1.3",
"detect-indent": "^5.0.0",
"editorconfig": "^0.15.0",
- "find-up": "^2.1.0",
- "fs-extra": "^4.0.2",
- "js-yaml": "^3.10.0",
+ "find-up": "^3.0.0",
+ "fs-extra": "^7.0.0",
+ "js-yaml": "^3.12.0",
+ "kleur": "^2.0.2",
"listify": "^1.0.0",
- "lodash": "^4.17.4",
+ "lodash": "^4.17.10",
+ "minimist": "^1.2.0",
"prop-ini": "^0.0.2",
- "readme-badger": "^0.2.0",
+ "readme-badger": "^0.3.0",
+ "semver": "^5.5.1",
"smpltmpl": "^1.0.2",
- "split-lines": "^1.1.0",
+ "split-lines": "^2.0.0",
"strip-bom": "^3.0.0",
- "webpack-merge": "^4.1.1"
+ "webpack-merge": "^4.1.4"
},
"dependencies": {
- "detect-indent": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz",
- "integrity": "sha1-OHHMCmoALow+Wzz38zYmRnXwa50=",
+ "find-up": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
+ "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
+ "dev": true,
+ "requires": {
+ "locate-path": "^3.0.0"
+ }
+ },
+ "locate-path": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
+ "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
+ "dev": true,
+ "requires": {
+ "p-locate": "^3.0.0",
+ "path-exists": "^3.0.0"
+ }
+ },
+ "minimist": {
+ "version": "1.2.0",
+ "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+ "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
+ "dev": true
+ },
+ "p-limit": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.0.0.tgz",
+ "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==",
+ "dev": true,
+ "requires": {
+ "p-try": "^2.0.0"
+ }
+ },
+ "p-locate": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
+ "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
+ "dev": true,
+ "requires": {
+ "p-limit": "^2.0.0"
+ }
+ },
+ "p-try": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz",
+ "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==",
"dev": true
}
}
@@ -9067,9 +9162,9 @@
}
},
"node-releases": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.0.5.tgz",
- "integrity": "sha512-Ky7q0BO1BBkG/rQz6PkEZ59rwo+aSfhczHP1wwq8IowoVdN/FpiP7qp0XW0P2+BVCWe5fQUBozdbVd54q1RbCQ==",
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.1.tgz",
+ "integrity": "sha512-2UXrBr6gvaebo5TNF84C66qyJJ6r0kxBObgZIDX3D3/mt1ADKiHux3NJPWisq0wxvJJdkjECH+9IIKYViKj71Q==",
"dev": true,
"requires": {
"semver": "^5.3.0"
@@ -9411,12 +9506,26 @@
}
},
"parse-git-config": {
- "version": "0.2.0",
- "resolved": "http://registry.npmjs.org/parse-git-config/-/parse-git-config-0.2.0.tgz",
- "integrity": "sha1-Jygz/dFf6hRvt10zbSNrljtv9wY=",
+ "version": "1.1.1",
+ "resolved": "http://registry.npmjs.org/parse-git-config/-/parse-git-config-1.1.1.tgz",
+ "integrity": "sha1-06mYQxcTL1c5hxK7pDjhKVkN34w=",
"dev": true,
"requires": {
- "ini": "^1.3.3"
+ "extend-shallow": "^2.0.1",
+ "fs-exists-sync": "^0.1.0",
+ "git-config-path": "^1.0.1",
+ "ini": "^1.3.4"
+ },
+ "dependencies": {
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ }
}
},
"parse-github-repo-url": {
@@ -9425,6 +9534,12 @@
"integrity": "sha1-nn2LslKmy2ukJZUGC3v23z28H1A=",
"dev": true
},
+ "parse-github-url": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.2.tgz",
+ "integrity": "sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==",
+ "dev": true
+ },
"parse-glob": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz",
@@ -9464,6 +9579,12 @@
"json-parse-better-errors": "^1.0.1"
}
},
+ "parse-passwd": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz",
+ "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=",
+ "dev": true
+ },
"parse5": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz",
@@ -9478,7 +9599,7 @@
},
"path-browserify": {
"version": "0.0.0",
- "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz",
+ "resolved": "http://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz",
"integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=",
"dev": true
},
@@ -10122,9 +10243,9 @@
"dev": true
},
"progress": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.2.tgz",
- "integrity": "sha512-/OLz5F9beZUWwSHZDreXgap1XShX6W+DCHQCqwCF7uZ88s6uTlD2cR3JBE77SegCmNtb1Idst+NfmwcdU6KVhw==",
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
+ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
"dev": true
},
"promise-inflight": {
@@ -10165,9 +10286,9 @@
"dev": true
},
"psl": {
- "version": "1.1.29",
- "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz",
- "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==",
+ "version": "1.1.31",
+ "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz",
+ "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==",
"dev": true
},
"public-encrypt": {
@@ -10358,10 +10479,13 @@
}
},
"readme-badger": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/readme-badger/-/readme-badger-0.2.0.tgz",
- "integrity": "sha1-H9tEgkj7XUDYhW+9Jp3YuSfRr/g=",
- "dev": true
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/readme-badger/-/readme-badger-0.3.0.tgz",
+ "integrity": "sha512-+sMOLSs1imZUISZ2Rhz7qqVd77QtpcAPbGeIraFdgJmijb04YtdlPjGNBvDChTNtLbeQ6JNGQy3pOgslWfaP3g==",
+ "dev": true,
+ "requires": {
+ "balanced-match": "^1.0.0"
+ }
},
"realpath-native": {
"version": "1.0.2",
@@ -10479,12 +10603,12 @@
}
},
"remote-origin-url": {
- "version": "0.4.0",
- "resolved": "http://registry.npmjs.org/remote-origin-url/-/remote-origin-url-0.4.0.tgz",
- "integrity": "sha1-TT4pAvNOLTfRwmPYdxC3frQIajA=",
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/remote-origin-url/-/remote-origin-url-1.0.0.tgz",
+ "integrity": "sha512-xHDM6IBqivpiQ1e4WOuFpM/T6rbzA/WBsu+3WLtgPOhHyjA0nYlijV3NprlTb4FcXlQ5+Q+z174sQ1NnUF5FwA==",
"dev": true,
"requires": {
- "parse-git-config": "^0.2.0"
+ "parse-git-config": "^1.1.1"
}
},
"remove-trailing-separator": {
@@ -10784,9 +10908,9 @@
}
},
"sass": {
- "version": "1.15.1",
- "resolved": "https://registry.npmjs.org/sass/-/sass-1.15.1.tgz",
- "integrity": "sha512-WiDa5BsePB/rQEbh/Fv2pVDUCasxuRYjW7GsWx8Ld23LY61vx1VV5Mzf/7mu5kLWKMryMqo65fzYL34HgaM47w==",
+ "version": "1.15.2",
+ "resolved": "https://registry.npmjs.org/sass/-/sass-1.15.2.tgz",
+ "integrity": "sha512-YFncPpx3ewKEhMg9sWdCxKUpPN/jwVLa0Q9iO2tcV5Y5Z/YAlFV6k6JaQwq3tmbN6FXKjUYElXRHcG0g4D1zkQ==",
"dev": true,
"requires": {
"chokidar": "^2.0.0"
@@ -11165,9 +11289,9 @@
"dev": true
},
"spdx-correct": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.2.tgz",
- "integrity": "sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ==",
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz",
+ "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==",
"dev": true,
"requires": {
"spdx-expression-parse": "^3.0.0",
@@ -11206,9 +11330,9 @@
}
},
"split-lines": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/split-lines/-/split-lines-1.1.0.tgz",
- "integrity": "sha1-Oruo9ZhhQUL5240nq2q4dWYqHgk=",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/split-lines/-/split-lines-2.0.0.tgz",
+ "integrity": "sha512-gaIdhbqxkB5/VflPXsJwZvEzh/kdwiRPF9iqpkxX4us+lzB8INedFwjCyo6vwuz5x2Ddlnav2zh270CEjCG8mA==",
"dev": true
},
"split-string": {
@@ -11231,7 +11355,7 @@
},
"sprintf-js": {
"version": "1.0.3",
- "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
+ "resolved": "http://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
"dev": true
},
@@ -12089,7 +12213,7 @@
},
"tty-browserify": {
"version": "0.0.0",
- "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",
+ "resolved": "http://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",
"integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=",
"dev": true
},
@@ -12425,7 +12549,7 @@
},
"vm-browserify": {
"version": "0.0.4",
- "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz",
+ "resolved": "http://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz",
"integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=",
"dev": true,
"requires": {
@@ -12486,9 +12610,9 @@
"dev": true
},
"webpack": {
- "version": "4.27.0",
- "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.27.0.tgz",
- "integrity": "sha512-y77EQNIlsB9fUGgpLv/ZzmH+Yd9DgyIF9omX9RFavR5ZFM6HxFm6sqkbBXYxpjbKej9K6hD+Y8qEVg2rWdI2gg==",
+ "version": "4.27.1",
+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.27.1.tgz",
+ "integrity": "sha512-WArHiLvHrlfyRM8i7f+2SFbr/XbQ0bXqTkPF8JpHOzub5482Y3wx7rEO8stuLGOKOgZJcqcisLhD7LrM/+fVMw==",
"dev": true,
"requires": {
"@webassemblyjs/ast": "1.7.11",
@@ -12535,23 +12659,10 @@
}
}
},
- "webpack-defaults": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/webpack-defaults/-/webpack-defaults-2.3.0.tgz",
- "integrity": "sha512-wypNnxiFwpZPHmIW4ulsBW+ZMUaPiRwVS5wiDw1UQ0u1pObBvxqlt0pjywhxSHcQsjilqRXZOd9pcM0QnOEV4w==",
- "dev": true,
- "requires": {
- "chalk": "^2.3.0",
- "git-username": "^0.5.0",
- "mrm-core": "^2.6.0",
- "path-exists": "^3.0.0",
- "user-meta": "^1.0.0"
- }
- },
"webpack-merge": {
- "version": "4.1.4",
- "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.1.4.tgz",
- "integrity": "sha512-TmSe1HZKeOPey3oy1Ov2iS3guIZjWvMT2BBJDzzT5jScHTjVC3mpjJofgueEzaEd6ibhxRDD6MIblDr8tzh8iQ==",
+ "version": "4.1.5",
+ "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.1.5.tgz",
+ "integrity": "sha512-sVcM+MMJv6DO0C0GLLltx8mUlGMKXE0zBsuMqZ9jz2X9gsekALw6Rs0cAfTWc97VuWS6NpVUa78959zANnMMLQ==",
"dev": true,
"requires": {
"lodash": "^4.17.5"
diff --git a/package.json b/package.json
index 48b0e37c..360892fb 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "css-loader",
- "version": "1.0.1",
+ "version": "2.0.1",
"description": "css loader module for webpack",
"license": "MIT",
"repository": "webpack-contrib/css-loader",
@@ -15,6 +15,8 @@
"start": "npm run build -- -w",
"build": "cross-env NODE_ENV=production babel src -d dist --ignore 'src/**/*.test.js' --copy-files",
"clean": "del-cli dist",
+ "commitlint": "commitlint",
+ "commitmsg": "commitlint -e $GIT_PARAMS",
"lint": "eslint --cache src test",
"prebuild": "npm run clean",
"prepublish": "npm run build",
@@ -24,9 +26,9 @@
"test:watch": "jest --watch",
"test:coverage": "jest --collectCoverageFrom='src/**/*.js' --coverage",
"ci:lint": "npm run lint && npm run security",
- "ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
"ci:test": "npm run test -- --runInBand",
"ci:coverage": "npm run test:coverage -- --runInBand",
+ "ci:lint:commits": "commitlint --from=origin/master --to=${CIRCLE_SHA1}",
"defaults": "webpack-defaults"
},
"files": [
@@ -56,6 +58,7 @@
"@babel/preset-env": "^7.1.6",
"@commitlint/cli": "^7.2.1",
"@commitlint/config-conventional": "^7.1.2",
+ "@webpack-contrib/defaults": "^3.0.0",
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^23.6.0",
@@ -77,8 +80,7 @@
"sass-loader": "^7.1.0",
"standard-version": "^4.0.0",
"strip-ansi": "^5.0.0",
- "webpack": "^4.26.1",
- "webpack-defaults": "^2.3.0"
+ "webpack": "^4.26.1"
},
"keywords": [
"webpack",
diff --git a/src/options.json b/src/options.json
index 9100eefa..45494ec7 100644
--- a/src/options.json
+++ b/src/options.json
@@ -52,7 +52,14 @@
"type": "string"
},
"getLocalIdent": {
- "instanceof": "Function"
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "instanceof": "Function"
+ }
+ ]
},
"sourceMap": {
"type": "boolean"
diff --git a/src/plugins/postcss-icss-parser.js b/src/plugins/postcss-icss-parser.js
index 1cb7a988..6730f50b 100644
--- a/src/plugins/postcss-icss-parser.js
+++ b/src/plugins/postcss-icss-parser.js
@@ -75,8 +75,12 @@ export default postcss.plugin(
// Replace tokens in at-rules
css.walkAtRules((atrule) => {
- // eslint-disable-next-line no-param-reassign
- atrule.params = replaceImportsInString(atrule.params.toString());
+ // Due reusing `ast` from `postcss-loader` some plugins may lack
+ // `params` property, we need to account for this possibility
+ if (atrule.params) {
+ // eslint-disable-next-line no-param-reassign
+ atrule.params = replaceImportsInString(atrule.params.toString());
+ }
});
// Replace tokens in export
diff --git a/test/__snapshots__/errors.test.js.snap b/test/__snapshots__/errors.test.js.snap
index 210dfcfb..e04c3b08 100644
--- a/test/__snapshots__/errors.test.js.snap
+++ b/test/__snapshots__/errors.test.js.snap
@@ -78,7 +78,9 @@ options.hashPrefix should be string
exports[`validation 10`] = `
"CSS Loader Invalid Options
+options.getLocalIdent should be boolean
options.getLocalIdent should pass \\"instanceof\\" keyword validation
+options.getLocalIdent should match some schema in anyOf
"
`;
diff --git a/test/__snapshots__/getLocalIdent-option.test.js.snap b/test/__snapshots__/getLocalIdent-option.test.js.snap
index 3204e460..16ce6a7b 100644
--- a/test/__snapshots__/getLocalIdent-option.test.js.snap
+++ b/test/__snapshots__/getLocalIdent-option.test.js.snap
@@ -30,6 +30,36 @@ Array [
exports[`getLocalIdent option should accepts arguments: warnings 1`] = `Array []`;
+exports[`getLocalIdent option should allow to use \`false\` value: errors 1`] = `Array []`;
+
+exports[`getLocalIdent option should allow to use \`false\` value: locals 1`] = `
+Object {
+ "abc": "before_abc__1hk_after",
+ "def": "before_def__3oo_after",
+ "ghi": "before_ghi__2ZR_after",
+ "jkl": "before_jkl__aQ1_after",
+}
+`;
+
+exports[`getLocalIdent option should allow to use \`false\` value: module (evaluated) 1`] = `
+Array [
+ Array [
+ 1,
+ ".before_abc__1hk_after .before_def__3oo_after {
+ color: red;
+}
+
+.before_ghi__2ZR_after .before_jkl__aQ1_after {
+ color: blue;
+}
+",
+ "",
+ ],
+]
+`;
+
+exports[`getLocalIdent option should allow to use \`false\` value: warnings 1`] = `Array []`;
+
exports[`getLocalIdent option should respect \`context\` option: errors 1`] = `Array []`;
exports[`getLocalIdent option should respect \`context\` option: locals 1`] = `
diff --git a/test/__snapshots__/modules-option.test.js.snap b/test/__snapshots__/modules-option.test.js.snap
index a2f04d71..bc011a5b 100644
--- a/test/__snapshots__/modules-option.test.js.snap
+++ b/test/__snapshots__/modules-option.test.js.snap
@@ -5378,3 +5378,62 @@ exports.locals = {
`;
exports[`modules issue #636: warnings 1`] = `Array []`;
+
+exports[`modules issue #861: errors 1`] = `Array []`;
+
+exports[`modules issue #861: module (evaluated) 1`] = `
+Array [
+ Array [
+ 2,
+ "
+",
+ "",
+ ],
+ Array [
+ 4,
+ "._1ef5Heix1Kf4k0qYvyWRRO {
+ display: flex;
+}
+",
+ "",
+ ],
+ Array [
+ 3,
+ ".L8pnpYm5VAu49S290uPMA {
+ color: red;
+ margin: 0;
+ padding: 0;
+}
+",
+ "",
+ ],
+ Array [
+ 1,
+ "._2gV2e6TcHcPgyDTzxbvkKa {
+ color: gray;
+ margin: 0;
+ padding: 0;
+}
+",
+ "",
+ ],
+]
+`;
+
+exports[`modules issue #861: module 1`] = `
+"exports = module.exports = require(\\"../../../src/runtime/api.js\\")(false);
+// Imports
+exports.i(require(\\"-!../../../src/index.js??ref--4-0!@localpackage/color.css\\"), \\"\\");
+exports.i(require(\\"-!../../../src/index.js??ref--4-0!@localpackage/style.css\\"), \\"\\");
+
+// Module
+exports.push([module.id, \\"._2gV2e6TcHcPgyDTzxbvkKa {\\\\n color: \\" + require(\\"-!../../../src/index.js??ref--4-0!@localpackage/color.css\\").locals[\\"color-grey\\"] + \\";\\\\n margin: 0;\\\\n padding: 0;\\\\n}\\\\n\\", \\"\\"]);
+
+// Exports
+exports.locals = {
+ \\"color-grey\\": \\"\\" + require(\\"-!../../../src/index.js??ref--4-0!@localpackage/color.css\\").locals[\\"color-grey\\"] + \\"\\",
+ \\"copyright\\": \\"_2gV2e6TcHcPgyDTzxbvkKa \\" + require(\\"-!../../../src/index.js??ref--4-0!@localpackage/style.css\\").locals[\\"type-heading\\"] + \\"\\"
+};"
+`;
+
+exports[`modules issue #861: warnings 1`] = `Array []`;
diff --git a/test/errors.test.js b/test/errors.test.js
index 14b87d36..6c3d3970 100644
--- a/test/errors.test.js
+++ b/test/errors.test.js
@@ -58,9 +58,8 @@ it('validation', () => {
expect(() => validate({ hashPrefix: true })).toThrowErrorMatchingSnapshot();
expect(() => validate({ getLocalIdent: () => {} })).not.toThrow();
- expect(() =>
- validate({ getLocalIdent: true })
- ).toThrowErrorMatchingSnapshot();
+ expect(() => validate({ getLocalIdent: false })).not.toThrow();
+ expect(() => validate({ getLocalIdent: [] })).toThrowErrorMatchingSnapshot();
expect(() => validate({ sourceMap: true })).not.toThrow();
expect(() => validate({ sourceMap: false })).not.toThrow();
diff --git a/test/fixtures/modules/node_modules/@localpackage/color.css b/test/fixtures/modules/node_modules/@localpackage/color.css
new file mode 100644
index 00000000..7ae91afb
--- /dev/null
+++ b/test/fixtures/modules/node_modules/@localpackage/color.css
@@ -0,0 +1 @@
+@value color-grey: gray;
diff --git a/test/fixtures/modules/node_modules/@localpackage/style.css b/test/fixtures/modules/node_modules/@localpackage/style.css
new file mode 100644
index 00000000..0e3b37bf
--- /dev/null
+++ b/test/fixtures/modules/node_modules/@localpackage/style.css
@@ -0,0 +1,6 @@
+.type-heading {
+ color: red;
+ composes: type-heading2 from "~@otherlocalpackage/style.css";
+ margin: 0;
+ padding: 0;
+}
diff --git a/test/fixtures/modules/node_modules/@otherlocalpackage/style.css b/test/fixtures/modules/node_modules/@otherlocalpackage/style.css
new file mode 100644
index 00000000..1567804b
--- /dev/null
+++ b/test/fixtures/modules/node_modules/@otherlocalpackage/style.css
@@ -0,0 +1,3 @@
+.type-heading2 {
+ display: flex;
+}
diff --git a/test/fixtures/modules/resolving-inside-node-modules.css b/test/fixtures/modules/resolving-inside-node-modules.css
new file mode 100644
index 00000000..a9986d8f
--- /dev/null
+++ b/test/fixtures/modules/resolving-inside-node-modules.css
@@ -0,0 +1,8 @@
+@value color-grey from "~@localpackage/color.css";
+
+.copyright {
+ color: color-grey;
+ composes: type-heading from "~@localpackage/style.css";
+ margin: 0;
+ padding: 0;
+}
diff --git a/test/getLocalIdent-option.test.js b/test/getLocalIdent-option.test.js
index b7c3fbbb..1c560171 100644
--- a/test/getLocalIdent-option.test.js
+++ b/test/getLocalIdent-option.test.js
@@ -104,4 +104,27 @@ describe('getLocalIdent option', () => {
expect(stats.compilation.warnings).toMatchSnapshot('warnings');
expect(stats.compilation.errors).toMatchSnapshot('errors');
});
+
+ it('should allow to use `false` value', async () => {
+ const config = {
+ loader: {
+ options: {
+ context: path.resolve(__dirname, 'fixtures/modules'),
+ modules: true,
+ localIdentName: 'before_[local]__[hash:base64:3]_after',
+ getLocalIdent: false,
+ },
+ },
+ };
+ const testId = './modules/getLocalIdent.css';
+ const stats = await webpack(testId, config);
+ const { modules } = stats.toJson();
+ const module = modules.find((m) => m.id === testId);
+ const evaluatedModule = evaluated(module.source);
+
+ expect(evaluatedModule).toMatchSnapshot('module (evaluated)');
+ expect(evaluatedModule.locals).toMatchSnapshot('locals');
+ expect(stats.compilation.warnings).toMatchSnapshot('warnings');
+ expect(stats.compilation.errors).toMatchSnapshot('errors');
+ });
});
diff --git a/test/modules-option.test.js b/test/modules-option.test.js
index 048766de..3b83ff4e 100644
--- a/test/modules-option.test.js
+++ b/test/modules-option.test.js
@@ -117,4 +117,21 @@ describe('modules', () => {
expect(stats.compilation.warnings).toMatchSnapshot('warnings');
expect(stats.compilation.errors).toMatchSnapshot('errors');
});
+
+ it('issue #861', async () => {
+ const config = {
+ loader: { options: { modules: true } },
+ };
+ const testId = './modules/resolving-inside-node-modules.css';
+ const stats = await webpack(testId, config);
+ const { modules } = stats.toJson();
+ const module = modules.find((m) => m.id === testId);
+
+ expect(module.source).toMatchSnapshot('module');
+ expect(evaluated(module.source, modules)).toMatchSnapshot(
+ 'module (evaluated)'
+ );
+ expect(stats.compilation.warnings).toMatchSnapshot('warnings');
+ expect(stats.compilation.errors).toMatchSnapshot('errors');
+ });
});