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/style-loader
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.0
Choose a base ref
...
head repository: webpack-contrib/style-loader
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.0.0
Choose a head ref
  • 11 commits
  • 80 files changed
  • 5 contributors

Commits on Oct 13, 2020

  1. Copy the full SHA
    bc003c7 View commit details
  2. Merge pull request #492 from webpack-contrib/ci-updated

    ci: updated webpack versions
    cap-Bernardito authored Oct 13, 2020
    Copy the full SHA
    256b1c3 View commit details

Commits on Feb 27, 2021

  1. Verified

    This commit was signed with the committer’s verified signature.
    scala-steward Scala Steward
    Copy the full SHA
    6134c6e View commit details

Commits on Apr 2, 2021

  1. Verified

    This commit was signed with the committer’s verified signature.
    scala-steward Scala Steward
    Copy the full SHA
    d34313a View commit details

Commits on May 19, 2021

  1. Verified

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

Commits on Jun 7, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7cfe35e View commit details
  2. chore: fix typo (#512)

    snitin315 authored Jun 7, 2021
    Copy the full SHA
    0b9ec95 View commit details

Commits on Jun 18, 2021

  1. chore: update deps (#516)

    snitin315 authored Jun 18, 2021
    Copy the full SHA
    aee2997 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
    99c6500 View commit details

Commits on Jun 24, 2021

  1. refactor: next (#501)

    cap-Bernardito authored Jun 24, 2021
    Copy the full SHA
    5238a15 View commit details
  2. chore(release): 3.0.0

    alexander-akait committed Jun 24, 2021
    Copy the full SHA
    1556c0b View commit details
Showing with 33,577 additions and 10,387 deletions.
  1. +11 −11 .eslintrc.js
  2. +1 −1 .github/ISSUE_TEMPLATE.md
  3. +4 −4 .github/workflows/nodejs.yml
  4. +1 −0 .husky/.gitignore
  5. +4 −0 .husky/commit-msg
  6. +4 −0 .husky/pre-commit
  7. +0 −1 .prettierrc.js
  8. +16 −0 CHANGELOG.md
  9. +160 −98 README.md
  10. +5 −5 babel.config.js
  11. +1 −1 commitlint.config.js
  12. +0 −6 husky.config.js
  13. +2 −2 lint-staged.config.js
  14. +23,602 −8,082 package-lock.json
  15. +34 −40 package.json
  16. +1 −1 src/cjs.js
  17. +161 −257 src/index.js
  18. +6 −9 src/options.json
  19. +29 −0 src/runtime/getTarget.js
  20. +7 −48 src/runtime/injectStylesIntoLinkTag.js
  21. +4 −192 src/runtime/injectStylesIntoStyleTag.js
  22. +12 −0 src/runtime/insertStyleElement.js
  23. +2 −2 src/runtime/isEqualLocals.js
  24. +17 −0 src/runtime/isOldIE.js
  25. +65 −0 src/runtime/singletonStyleDomAPI.js
  26. +47 −0 src/runtime/styleDomAPI.js
  27. +294 −0 src/utils.js
  28. +114 −0 test/__snapshots__/attributes-option.test.js.snap
  29. +7,291 −251 test/__snapshots__/esModule-option.test.js.snap
  30. +48 −0 test/__snapshots__/injectType-option.test.js.snap
  31. +312 −0 test/__snapshots__/loader.test.js.snap
  32. +0 −93 test/__snapshots__/modules-option.test.js.snap
  33. +101 −0 test/__snapshots__/styleTagTransform-option.test.js.snap
  34. +21 −15 test/__snapshots__/validate-options.test.js.snap
  35. +44 −24 test/attributes-option.test.js
  36. +7 −7 test/base-option.test.js
  37. +4 −4 test/cjs.test.js
  38. +113 −224 test/esModule-option.test.js
  39. +3 −0 test/fixtures/commonjs-modules.js
  40. +11 −0 test/fixtures/es-modules.css
  41. +3 −0 test/fixtures/es-modules.js
  42. +3 −0 test/fixtures/lazy-commonjs-modules.js
  43. +3 −0 test/fixtures/lazy-es-modules.js
  44. +2 −3 test/helpers/compile.js
  45. +4 −4 test/helpers/execute.js
  46. +16 −20 test/helpers/getCompiler.js
  47. +2 −2 test/helpers/getEntryByInjectType.js
  48. +2 −4 test/helpers/getErrors.js
  49. +2 −4 test/helpers/getWarnings.js
  50. +10 −10 test/helpers/index.js
  51. +7 −8 test/helpers/normalizeErrors.js
  52. +3 −3 test/helpers/readAsset.js
  53. +1 −1 test/helpers/readAssets.js
  54. +4 −4 test/helpers/runInJsDom.js
  55. +13 −11 test/injectType-option.test.js
  56. +49 −49 test/insert-option.test.js
  57. +96 −94 test/loader.test.js
  58. +1 −1 test/manual/src/component.lazy.module.css
  59. +1 −1 test/manual/src/component.module.css
  60. +6 −6 test/manual/src/custom-square.js
  61. +1 −240 test/manual/src/index.js
  62. +1 −1 test/manual/src/modules/one.module.css
  63. +1 −1 test/manual/src/modules/page.module.css
  64. +1 −1 test/manual/src/modules/two.module.css
  65. +2 −2 test/manual/src/nested.css
  66. +1 −1 test/manual/src/nested/style.css
  67. +8 −8 test/manual/src/order.css
  68. +1 −1 test/manual/src/other-style.lazy.scss
  69. +1 −1 test/manual/src/other-style.scss
  70. +1 −1 test/manual/src/style.css
  71. +1 −1 test/manual/src/style.lazy.css
  72. +1 −1 test/manual/src/style.named-export.lazy.module.css
  73. +1 −1 test/manual/src/style.named-export.module.css
  74. +36 −42 test/manual/webpack.config.js
  75. +0 −64 test/modules-option.test.js
  76. +80 −42 test/runtime/injectStylesIntoLinkTag.test.js
  77. +519 −331 test/runtime/injectStylesIntoStyleTag.test.js
  78. +25 −25 test/runtime/isEqualLocals.test.js
  79. +86 −0 test/styleTagTransform-option.test.js
  80. +23 −20 test/validate-options.test.js
22 changes: 11 additions & 11 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
module.exports = {
root: true,
extends: ['@webpack-contrib/eslint-config-webpack', 'prettier'],
extends: ["@webpack-contrib/eslint-config-webpack", "prettier"],
overrides: [
{
files: ['src/runtime/**/*.js'],
files: ["src/runtime/**/*.js"],
env: {
browser: true,
node: true,
},
globals: {
__webpack_nonce__: 'readonly',
__webpack_nonce__: "readonly",
},
rules: {
'no-underscore-dangle': 'off',
'no-plusplus': 'off',
'consistent-return': 'off',
'no-param-reassign': 'off',
"no-underscore-dangle": "off",
"no-plusplus": "off",
"consistent-return": "off",
"no-param-reassign": "off",
camelcase: [
'error',
{ properties: 'never', allow: ['__webpack_nonce__'] },
"error",
{ properties: "never", allow: ["__webpack_nonce__"] },
],
// avoid unnecessary `babel` helpers
'prefer-destructuring': 'off',
'prefer-rest-params': 'off',
"prefer-destructuring": "off",
"prefer-rest-params": "off",
},
},
],
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
You arrived at this template because you felt none of the other options
matched the kind of issue you'd like to report. Please use this opportunity to
tell us about your particular type of issue so we can try to accomodate
tell us about your particular type of issue so we can try to accommodate
similar issues in the future.
PLEASE do note, if you're using this to report an issue already covered by the
8 changes: 4 additions & 4 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -29,10 +29,10 @@ jobs:
with:
fetch-depth: 0

- name: Use Node.js ${{ env.node-version }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.node-version }}
node-version: ${{ matrix.node-version }}

- name: Use latest NPM
run: sudo npm i -g npm
@@ -55,8 +55,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [10.x, 12.x, 14.x]
webpack-version: [latest, next]
node-version: [12.x, 14.x, 16.x]
webpack-version: [latest]

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

1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install lint-staged
1 change: 0 additions & 1 deletion .prettierrc.js

This file was deleted.

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

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.

## [3.0.0](https://github.com/webpack-contrib/style-loader/compare/v2.0.0...v3.0.0) (2021-06-24)

### ⚠ BREAKING CHANGES

* minimum supported `Node.js` version is `12.13.0`
* minimum supported `webpack` version is `5.0.0`
* the `modules.namedExport` option was removed, you don't need it anymore, because we respect the `modules.namedExport` option from `css-loader` (we just reexport all from `css-loader`), just remove it
* the `styleTag` value of the `injectType` (default value) option earlier uses singleton style tag by default for IE8-IE9 due limitations ([more information](https://www.telerik.com/blogs/internet-explorer-css-limits)), in this release we have disabled this behavior, because these versions of IE are outdated, if you don't support these browsers this change does not affect you, if you require to support IE8-IE9, you can return old behaviour by setting `autoStyleTag` value for the `injectType` option (do the same for `lazyStyleTag`, i.e. change it to `lazyAutoStyleTag`)

### Features

* added `autoStyleTag` and `lazyAutoStyleTag` values for the `injectType` option for compatibility of work modern and IE8-IE9 browsers
* added `styleTagTransform` option for custom processing style tags (useful if you need ponyfill CSS custom properties for IE8-IE10)
* reduce size of generated code
* reduce deps

## [2.0.0](https://github.com/webpack-contrib/style-loader/compare/v1.3.0...v2.0.0) (2020-10-09)


Loading