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: v4.3.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: v5.0.0
Choose a head ref
  • 15 commits
  • 50 files changed
  • 5 contributors

Commits on Sep 22, 2020

  1. refactor: remove icss option (#1189)

    BRAKING CHANGE: the `icss` option was removed, please use `modules.compileType: 'icss'`
    cap-Bernardito authored Sep 22, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cfe669f View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    df111b8 View commit details
  3. feat: auto enable icss modules

    BREAKING CHANGE: Auto enable icss modules for all files for which /\.icss\.\w+$/i.test(filename)
    cap-Bernardito authored Sep 22, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2f1573f View commit details

Commits on Sep 23, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0f95841 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    52412f6 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    dd52931 View commit details

Commits on Sep 24, 2020

  1. feat: escape getLocalIdent by default (#1196)

    BREAKING CHANGE: returned value from the `getLocalIdent` escapes by default, the `exportName` value is always unescaped
    cap-Bernardito authored Sep 24, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d779eb1 View commit details
  2. feat: reduce runtime

    BREAKING CHANGE: runtime doesn't contain source maps function without `sourceMap: true`
    cap-Bernardito authored Sep 24, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9f974be View commit details
  3. refactor: emoji deprecate

    BREAKING CHANGE: `emoji` was deprecated
    cap-Bernardito authored Sep 24, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    63b41be View commit details

Commits on Oct 6, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e5a9272 View commit details

Commits on Oct 7, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    92fe103 View commit details

Commits on Oct 8, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b5c9379 View commit details

Commits on Oct 13, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7bfe85d View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    747d62b View commit details
  3. chore(release): 5.0.0

    alexander-akait committed Oct 13, 2020
    Copy the full SHA
    1351e3a View commit details
Showing with 3,739 additions and 2,990 deletions.
  1. +3 −3 .github/workflows/nodejs.yml
  2. +2 −0 .gitignore
  3. +20 −0 CHANGELOG.md
  4. +5 −3 README.md
  5. +1,979 −2,025 package-lock.json
  6. +28 −28 package.json
  7. +2 −1 src/CssSyntaxError.js
  8. +13 −2 src/index.js
  9. +0 −4 src/options.json
  10. +83 −75 src/plugins/postcss-icss-parser.js
  11. +171 −174 src/plugins/postcss-import-parser.js
  12. +178 −169 src/plugins/postcss-url-parser.js
  13. +2 −32 src/runtime/api.js
  14. +20 −0 src/runtime/cssWithMappingToString.js
  15. +91 −38 src/utils.js
  16. +6 −6 test/__snapshots__/esModule-option.test.js.snap
  17. +45 −10 test/__snapshots__/import-option.test.js.snap
  18. +6 −6 test/__snapshots__/importLoaders-option.test.js.snap
  19. +34 −9 test/__snapshots__/loader.test.js.snap
  20. +558 −319 test/__snapshots__/modules-option.test.js.snap
  21. +29 −18 test/__snapshots__/sourceMap-option.test.js.snap
  22. +45 −5 test/__snapshots__/url-option.test.js.snap
  23. +8 −20 test/__snapshots__/validate-options.test.js.snap
  24. +5 −0 test/fixtures/import/import-file-protocol.js
  25. +3 −0 test/fixtures/modules/issue-1191/issue-1191-custom.css
  26. +3 −0 test/fixtures/modules/issue-1191/issue-1191.css
  27. +8 −0 test/fixtures/modules/issue-1191/issue-1191.js
  28. +19 −0 test/fixtures/modules/issue-966/issue-966.css
  29. +5 −0 test/fixtures/modules/issue-966/issue-966.js
  30. +5 −0 test/fixtures/modules/mode/icss/icss.js
  31. +11 −0 test/fixtures/modules/mode/icss/relative.icss.css
  32. +3 −0 test/fixtures/modules/mode/icss/vars.icss.css
  33. +5 −0 test/fixtures/modules/mode/modules-2.js
  34. +3 −0 test/fixtures/modules/mode/relative.modules.css
  35. +24 −0 test/fixtures/modules/namedExport/composes/composes.css
  36. +5 −0 test/fixtures/modules/namedExport/composes/composes.js
  37. +4 −0 test/fixtures/modules/namedExport/composes/values.css
  38. +7 −0 test/fixtures/modules/namedExport/dashesOnly/index.css
  39. +5 −0 test/fixtures/modules/namedExport/dashesOnly/index.js
  40. +3 −0 test/fixtures/source-map/extract.js
  41. +5 −0 test/fixtures/url/url-file-protocol.js
  42. +2 −2 test/helpers/getErrors.js
  43. +14 −1 test/helpers/normalizeErrors.js
  44. +23 −0 test/import-option.test.js
  45. +25 −2 test/loader.test.js
  46. +155 −19 test/modules-option.test.js
  47. +28 −10 test/runtime/api.test.js
  48. +5 −5 test/sourceMap-option.test.js
  49. +36 −0 test/url-option.test.js
  50. +0 −4 test/validate-options.test.js
6 changes: 3 additions & 3 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -43,8 +43,8 @@ jobs:
- name: Lint
run: npm run lint

# - name: Security audit
# run: npm run security
- name: Security audit
run: npm run security

- name: Check commit message
uses: wagoid/commitlint-github-action@v1
@@ -56,7 +56,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [10.x, 12.x, 14.x]
webpack-version: [latest, next]
webpack-version: [4, latest]

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

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -11,6 +11,8 @@ npm-debug.log*
/test/fixtures/import/import-absolute.css
/test/fixtures/url/url-absolute.css
/test/fixtures/modules/composes/composes-absolute.css
/test/fixtures/import/import-file-protocol.css
/test/fixtures/url/url-file-protocol.css

.DS_Store
Thumbs.db
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,26 @@

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.

## [5.0.0](https://github.com/webpack-contrib/css-loader/compare/v4.3.0...v5.0.0) (2020-10-13)


### ⚠ BREAKING CHANGES

* migrate on PostCSS 8
* runtime doesn't contain source maps code without `sourceMap: true`
* returned value from the `getLocalIdent` escapes by default, the `exportName` value is always unescaped
* Auto enable icss modules for all files for which `/\.icss\.\w+$/i` (the `modules.compileType` option is `icss`)
* `[emoji]` placeholder was deprecated
* `icss` option was removed (it was deprecated previously)

### Features

* allow named exports to have underscores in names ([#1209](https://github.com/webpack-contrib/css-loader/issues/1209)) ([747d62b](https://github.com/webpack-contrib/css-loader/commit/747d62b75a878d8881f4819b96297667dc689b8f))
* hide warning when you don't need handle `url()`/`@import` ([#1195](https://github.com/webpack-contrib/css-loader/issues/1195)) ([dd52931](https://github.com/webpack-contrib/css-loader/commit/dd52931150ed42f122d9017642437c26cc1b2422))
* improve error message ([52412f6](https://github.com/webpack-contrib/css-loader/commit/52412f6d5a54745ee37a4a67f038455c26ba5772))
* reduce runtime ([9f974be](https://github.com/webpack-contrib/css-loader/commit/9f974be81f5942d3afaf783529677bd541952fa3))
* add fallback if custom getLocalIdent returns `null`/`undefined` ([#1193](https://github.com/webpack-contrib/css-loader/issues/1193)) ([0f95841](https://github.com/webpack-contrib/css-loader/commit/0f9584135e63f9f354043e7f414e0c1aad0edc6e))

## [4.3.0](https://github.com/webpack-contrib/css-loader/compare/v4.2.2...v4.3.0) (2020-09-08)


8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -530,7 +530,7 @@ module.exports = {
auto: true,
exportGlobals: true,
localIdentName: '[path][name]__[local]--[hash:base64:5]',
context: path.resolve(__dirname, 'src'),
localIdentContext: path.resolve(__dirname, 'src'),
localIdentHashPrefix: 'my-custom-hash',
namedExport: true,
exportLocalsConvention: 'camelCase',
@@ -780,7 +780,7 @@ module.exports = {
loader: 'css-loader',
options: {
modules: {
context: path.resolve(__dirname, 'context'),
localIdentContext: path.resolve(__dirname, 'src'),
},
},
},
@@ -848,6 +848,8 @@ Default: `undefined`

Allows to specify a function to generate the classname.
By default we use built-in function to generate a classname.
If the custom function returns `null` or `undefined`, we fallback to the
built-in function to generate the classname.

**webpack.config.js**

@@ -1245,7 +1247,7 @@ module.exports = {

### Separating `Interoperable CSS`-only and `CSS Module` features

The following setup is an example of allowing `Interoperable CSS` features only (such as `:import` and `:export`) without using further `CSS Module` functionality by setting `compileType` option for all files that do not match `*.module.scss` naming convention. This is for reference as having `ICSS` features applied to all files was default `css-loader` behavior before v4.
The following setup is an example of allowing `Interoperable CSS` features only (such as `:import` and `:export`) without using further `CSS Module` functionality by setting `compileType` option for all files that do not match `*.module.scss` naming convention. This is for reference as having `ICSS` features applied to all files was default `css-loader` behavior before v4.
Meanwhile all files matching `*.module.scss` are treated as `CSS Modules` in this example.

An example case is assumed where a project requires canvas drawing variables to be synchronized with CSS - canvas drawing uses the same color (set by color name in JavaScript) as HTML background (set by class name in CSS).
Loading