Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: webpack-contrib/css-loader
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.6.0
Choose a base ref
...
head repository: webpack-contrib/css-loader
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.0.0
Choose a head ref

Commits on Jun 18, 2020

  1. docs: fix (#1095)

    evilebottnawi authored Jun 18, 2020
    Copy the full SHA
    fcdc1ab View commit details

Commits on Jul 7, 2020

  1. Copy the full SHA
    edf5347 View commit details
  2. Copy the full SHA
    f9b8ef9 View commit details

Commits on Jul 8, 2020

  1. Copy the full SHA
    76f1480 View commit details

Commits on Jul 13, 2020

  1. refactor: enables icss only when css modules enabled (#1103)

    BREAKING CHANGE: `icss` plugin disable by default, you need to setup the `modules` option to enable it
    cap-Bernardito authored Jul 13, 2020
    Copy the full SHA
    3b47d0d View commit details
  2. refactor: respect the devtool option (#1105)

    BREAKING CHANGE: default value of the `sourceMap` option depends on the `devtool` option
    cap-Bernardito authored Jul 13, 2020
    Copy the full SHA
    88e86ab View commit details

Commits on Jul 15, 2020

  1. Copy the full SHA
    56c0427 View commit details
  2. refactor: move the localsConvention option to the modules option

    BREAKING CHANGE: the `localsConvention` option was moved to the `module` option (`modules.localsConvention`)
    alexander-akait committed Jul 15, 2020
    Copy the full SHA
    cfc1432 View commit details
  3. chore: minimum required Node.js version is 10.13.0 (#1109)

    BREAKING CHANGE: minimum required `Node.js` version is `10.13.0`
    evilebottnawi authored Jul 15, 2020
    4
    Copy the full SHA
    cb80db0 View commit details

Commits on Jul 16, 2020

  1. Copy the full SHA
    d139ec1 View commit details
  2. Copy the full SHA
    bc19ddd View commit details
  3. Copy the full SHA
    7cca035 View commit details

Commits on Jul 17, 2020

  1. refactor: esModule option is true by default (#1111)

    BREAKING CHANGE: the `esModule` option is `true` by default
    cap-Bernardito authored Jul 17, 2020
    Copy the full SHA
    908ecee View commit details

Commits on Jul 20, 2020

  1. Copy the full SHA
    a5c1b5f View commit details

Commits on Jul 21, 2020

  1. refactor: code

    BREAKING CHANGE: inline syntax was changed
    evilebottnawi authored Jul 21, 2020
    Copy the full SHA
    ac5f413 View commit details
  2. refactor: rename the onlyLocals option (#1116)

    BREAKING CHANGE: the `onlyLocals` option was renamed to the `exportOnlyLocals` option and moved to the `module` option
    evilebottnawi authored Jul 21, 2020
    Copy the full SHA
    e1c55e4 View commit details
  3. refactor: default values modules and module.auto are true (#1117)

    BREAKING CHANGE: the `modules` option is `true` by default for all files matching `/\.module\.\w+$/i.test(filename)` regular expression, `module.auto` is `true` by default
    evilebottnawi authored Jul 21, 2020
    Copy the full SHA
    0080f88 View commit details
  4. refactor: the hashPrefix option was renamed to the `localIdentHashP…

    …refix` option (#1118)
    
    BREAKING CHANGE: the `hashPrefix` option was renamed to the `localIdentHashPrefix` option
    evilebottnawi authored Jul 21, 2020
    Copy the full SHA
    3a96a3d View commit details
  5. refactor: the modules.context option was renamed to the `modules.lo…

    …calIdentContext` option (#1119)
    
    BREAKING CHANGE: the `modules.context` option was renamed to the `modules.localIdentContext` option, default `modules.localIdentContext` value is `compiler.context` for the `module.getLocalIdent` option
    evilebottnawi authored Jul 21, 2020
    Copy the full SHA
    fc04401 View commit details
  6. refactor: the modules.localsConvention option was renamed to the `m…

    …odules.exportLocalsConvention` option (#1120)
    
    BREAKING CHANGE: the `modules.localsConvention` option was renamed to the `modules.exportLocalsConvention` option
    evilebottnawi authored Jul 21, 2020
    Copy the full SHA
    069dbb0 View commit details

Commits on Jul 22, 2020

  1. refactor: getLocalIdent function (#1121)

    BREAKING CHANGE: the `getLocalIndent` option should be always `Function` and should always return `String` value
    evilebottnawi authored Jul 22, 2020
    7
    Copy the full SHA
    d2f6bd2 View commit details
  2. Copy the full SHA
    58b4b98 View commit details
  3. Copy the full SHA
    c153fe6 View commit details
  4. refactor: change function arguments of the import option (#1124)

    BREAKING CHANGE: function arguments of the `import` option were changed, it is now `funciton(url, media, resourcePath) {}`
    evilebottnawi authored Jul 22, 2020
    Copy the full SHA
    01e8c76 View commit details
  5. Copy the full SHA
    791fff3 View commit details

Commits on Jul 23, 2020

  1. Copy the full SHA
    7f49a0a View commit details
  2. fix: parsing

    evilebottnawi authored Jul 23, 2020
    Copy the full SHA
    1c20b1e View commit details

Commits on Jul 24, 2020

  1. refactor: code

    evilebottnawi authored Jul 24, 2020
    Copy the full SHA
    83515fa View commit details
  2. Copy the full SHA
    5b45d87 View commit details
  3. test: imports

    evilebottnawi authored Jul 24, 2020
    Copy the full SHA
    a54c955 View commit details

Commits on Jul 25, 2020

  1. chore(deps): update

    alexander-akait committed Jul 25, 2020
    Copy the full SHA
    9aa0549 View commit details
  2. Copy the full SHA
    5303db2 View commit details
  3. Copy the full SHA
    5604205 View commit details
  4. chore(release): 4.0.0

    alexander-akait committed Jul 25, 2020
    Copy the full SHA
    7857d8f View commit details
Showing with 9,790 additions and 7,466 deletions.
  1. +1 −6 .github/workflows/nodejs.yml
  2. +35 −0 CHANGELOG.md
  3. +188 −103 README.md
  4. +1 −1 babel.config.js
  5. +2,466 −2,909 package-lock.json
  6. +23 −21 package.json
  7. +131 −87 src/index.js
  8. +40 −25 src/options.json
  9. +63 −55 src/plugins/postcss-icss-parser.js
  10. +110 −43 src/plugins/postcss-import-parser.js
  11. +190 −113 src/plugins/postcss-url-parser.js
  12. +303 −180 src/utils.js
  13. +136 −36 test/__snapshots__/esModule-option.test.js.snap
  14. +52 −52 test/__snapshots__/icss.test.js.snap
  15. +997 −250 test/__snapshots__/import-option.test.js.snap
  16. +40 −40 test/__snapshots__/importLoaders-option.test.js.snap
  17. +65 −47 test/__snapshots__/loader.test.js.snap
  18. +0 −320 test/__snapshots__/localsConvention-option.test.js.snap
  19. +3,299 −2,456 test/__snapshots__/modules-option.test.js.snap
  20. +0 −225 test/__snapshots__/onlyLocals-option.test.js.snap
  21. +149 −74 test/__snapshots__/sourceMap-option.test.js.snap
  22. +278 −134 test/__snapshots__/url-option.test.js.snap
  23. +62 −53 test/__snapshots__/validate-options.test.js.snap
  24. +138 −0 test/esModule-option.test.js
  25. +11 −0 test/fixtures/es-module/template/index.css
  26. +6 −0 test/fixtures/es-module/template/index.js
  27. +9 −0 test/fixtures/es-module/template/template.js
  28. +1 −0 test/fixtures/import/import-conditionNames.css
  29. +5 −0 test/fixtures/import/import-conditionNames.js
  30. +3 −0 test/fixtures/import/import-order.css
  31. +5 −0 test/fixtures/import/import-order.js
  32. +6 −0 test/fixtures/import/import-server-relative-url.css
  33. +5 −0 test/fixtures/import/import-server-relative-url.js
  34. +40 −5 test/fixtures/import/import.css
  35. +1 −0 test/fixtures/import/issue-683.css
  36. +5 −0 test/fixtures/import/issue-683.js
  37. +1 −0 test/fixtures/import/node_modules/issue-683/index.js
  38. +10 −0 test/fixtures/import/node_modules/issue-683/package.json
  39. +3 −0 test/fixtures/import/node_modules/issue-683/test.css
  40. 0 test/fixtures/import/node_modules/package-with-exports/index.cjs
  41. 0 test/fixtures/import/node_modules/package-with-exports/index.js
  42. +19 −0 test/fixtures/import/node_modules/package-with-exports/package.json
  43. +3 −0 test/fixtures/import/node_modules/package-with-exports/style.css
  44. +9 −0 test/fixtures/import/node_modules/test/package.json
  45. +3 −0 test/fixtures/import/node_modules/test/test.css
  46. +3 −0 test/fixtures/import/something.css
  47. +1 −0 test/fixtures/import/unresolved.css
  48. +5 −0 test/fixtures/import/unresolved.js
  49. +26 −0 test/fixtures/modules/composes/composes-preprocessors.css
  50. +5 −0 test/fixtures/modules/composes/composes-preprocessors.js
  51. +13 −1 test/fixtures/modules/composes/composes.css
  52. +8 −0 test/fixtures/modules/composes/less-file.less
  53. +11 −0 test/fixtures/modules/composes/scss-file.scss
  54. +8 −0 test/fixtures/modules/issue-914/source.css
  55. +5 −0 test/fixtures/modules/issue-914/source.js
  56. +7 −0 test/fixtures/modules/namedExport/base/index.css
  57. +5 −0 test/fixtures/modules/namedExport/base/index.js
  58. +3 −0 test/fixtures/modules/namedExport/broken/index.css
  59. +5 −0 test/fixtures/modules/namedExport/broken/index.js
  60. +20 −0 test/fixtures/modules/namedExport/nested/index.css
  61. +5 −0 test/fixtures/modules/namedExport/nested/index.js
  62. +11 −0 test/fixtures/modules/namedExport/template/index.css
  63. +8 −0 test/fixtures/modules/namedExport/template/index.js
  64. +11 −0 test/fixtures/modules/namedExport/template/template.js
  65. +2 −0 test/fixtures/modules/node_modules/test/index.css
  66. +9 −0 test/fixtures/modules/node_modules/test/package.json
  67. +1 −1 test/fixtures/modules/tests-cases/issue-589/source.css
  68. +6 −0 test/fixtures/modules/unresolved/source.css
  69. +5 −0 test/fixtures/modules/unresolved/source.js
  70. BIN test/fixtures/modules/url/img.png
  71. +1 −0 test/fixtures/modules/url/shared.css
  72. +10 −0 test/fixtures/modules/url/source.css
  73. +5 −0 test/fixtures/modules/url/source.js
  74. +2 −0 test/fixtures/simple-style.js
  75. +1 −1 test/fixtures/simple.css
  76. BIN test/fixtures/url/something.png
  77. +3 −0 test/fixtures/url/url-unresolved.css
  78. +5 −0 test/fixtures/url/url-unresolved.js
  79. +28 −2 test/fixtures/url/url.css
  80. +5 −0 test/helpers/getCompiler.js
  81. +2 −2 test/helpers/getErrors.js
  82. +1 −1 test/helpers/getModuleSource.js
  83. +21 −4 test/helpers/normalizeErrors.js
  84. +5 −0 test/helpers/preLoader.js
  85. +5 −0 test/helpers/string-loader.js
  86. +5 −0 test/helpers/url-loader.js
  87. +3 −1 test/icss.test.js
  88. +71 −3 test/import-option.test.js
  89. +38 −4 test/loader.test.js
  90. +0 −129 test/localsConvention-option.test.js
  91. +362 −23 test/modules-option.test.js
  92. +0 −45 test/onlyLocals-option.test.js
  93. +4 −0 test/runtime/__snapshots__/api.test.js.snap
  94. +26 −0 test/runtime/api.test.js
  95. +52 −0 test/sourceMap-option.test.js
  96. +8 −0 test/url-option.test.js
  97. +32 −14 test/validate-options.test.js
7 changes: 1 addition & 6 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -55,14 +55,9 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [8.x, 10.x, 12.x, 14.x]
node-version: [10.x, 12.x, 14.x]
webpack-version: [latest, next]

exclude:
# Webpack 5 does not support node 8
- node-version: 8.x
webpack-version: next

runs-on: ${{ matrix.os }}

steps:
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,41 @@

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.

## [4.0.0](https://github.com/webpack-contrib/css-loader/compare/v3.6.0...v4.0.0) (2020-07-25)


### ⚠ BREAKING CHANGES

* minimum required `Node.js` version is `10.13.0`
* minimum required `webpack` version is `4.27.0`
* the `esModule` option is `true` by default
* default value of the `sourceMap` option depends on the `devtool` option
* `icss` plugin disable by default, you need to setup the `modules` option to enable it
* the `modules` option is `true` by default for all files matching `/\.module\.\w+$/i.test(filename)` regular expression, `module.auto` is `true` by default
* the `modules.context` option was renamed to the `modules.localIdentContext` option
* default the `modules.localIdentContext` value is `compiler.context` for the `module.getLocalIdent` option
* the `modules.hashPrefix` option was renamed to the `modules.localIdentHashPrefix` option
* the `localsConvention` option was moved and renamed to the `modules.exportLocalsConvention` option
* the `getLocalIndent` option should be always `Function` and should always return `String` value
* the `onlyLocals` option was moved and renamed to the `modules.exportOnlyLocals` option
* function arguments of the `import` option were changed, it is now `funciton(url, media, resourcePath) {}`
* inline syntax was changed, please write `~` before the file request, i.e. rewrite `url(~!!loader!package/img.png)` to `url(!!loader!~package/img.png)`


### Features

* `@value` supports importing `url()` ([#1126](https://github.com/webpack-contrib/css-loader/issues/1126)) ([7f49a0a](https://github.com/webpack-contrib/css-loader/commit/7f49a0a6047846bb2e432558365e19d4a0dfb366))
* improve `url()` resolving algorithm ([bc19ddd](https://github.com/webpack-contrib/css-loader/commit/bc19ddd8779dafbc2a420870a3cb841041ce9c7c))
* named export for locals ([#1108](https://github.com/webpack-contrib/css-loader/issues/1108)) ([d139ec1](https://github.com/webpack-contrib/css-loader/commit/d139ec1d763f9944550b31f2a75183e488dd1224))
* respected the `style` field from package.json ([#1099](https://github.com/webpack-contrib/css-loader/issues/1099)) ([edf5347](https://github.com/webpack-contrib/css-loader/commit/edf5347e4203a62e50b87248a83da198afdc6eba))
* support `file:` protocol ([5604205](https://github.com/webpack-contrib/css-loader/commit/560420567eb0e1a635648b7f4ff0365db475384c))
* support server relative URLs

### Bug Fixes

* resolution algorithm, you don't need `~` inside packages in `node_modules` ([76f1480](https://github.com/webpack-contrib/css-loader/commit/76f1480b14265369ac5dc8dbbce467cfb8e814c5))


## [3.6.0](https://github.com/webpack-contrib/css-loader/compare/v3.5.3...v3.6.0) (2020-06-13)


Loading