diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 00000000..ddc88237 --- /dev/null +++ b/.cspell.json @@ -0,0 +1,48 @@ +{ + "version": "0.2", + "language": "en,en-gb", + "words": [ + "publicpath", + "memfs", + "crossorigin", + "Crossorigin", + "camelcase", + "unreload", + "cnfg", + "sorhus", + "sindre", + "staticc", + "deepc", + "pathinfo", + "iife", + "IIFE", + "fullhref", + "Unexception", + "fullhash", + "truetype", + "entrypoints", + "plusplus", + "hotreloading", + "chunkhash", + "concat", + "nosources", + "hspace", + "vspace", + "commitlint", + "unreload", + "cnfg" + ], + + "ignorePaths": [ + "CHANGELOG.md", + "package.json", + "dist/**", + "**/__snapshots__/**", + "package-lock.json", + "/test/js", + "/test/outputs", + "/test/cases", + "/test/fixtures", + "/test/manual/dist" + ] +} diff --git a/.eslintignore b/.eslintignore index 8477d2ab..cae9d895 100644 --- a/.eslintignore +++ b/.eslintignore @@ -4,3 +4,5 @@ /test/fixtures /test/cases/*/expected /test/js +/test/manual/dist +/types/**/* diff --git a/.eslintrc.js b/.eslintrc.js index c897f8ee..08daa9d3 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,5 +1,5 @@ module.exports = { root: true, - parser: 'babel-eslint', - extends: ['@webpack-contrib/eslint-config-webpack', 'prettier'], + parser: "@babel/eslint-parser", + extends: ["@webpack-contrib/eslint-config-webpack", "prettier"], }; diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index ad35b1f5..ca48f54f 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -149,7 +149,7 @@ Where `{id}` is the # ID of your Pull Request. ## Contributor License Agreement -When submitting your contribution, a CLA (Contributor License Agreement) bot will come by to verify that you signed the [CLA](https://cla.js.foundation/webpack-contrib/mini-css-extract-plugin). +When submitting your contribution, a CLA (Contributor License Agreement) bot will come by to verify that you signed the [CLA](https://easycla.lfx.linuxfoundation.org/#/?version=2). If it is your first time, it will link you to the right place to sign it. However, if you have committed your contributions using an email that is not the same as your email used on GitHub, the CLA bot can't accept your contribution. diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index f68cbd3e..3ce9cf32 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -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 diff --git a/.github/ISSUE_TEMPLATE/BUG.md b/.github/ISSUE_TEMPLATE/BUG.md index d5c817d1..909226ad 100644 --- a/.github/ISSUE_TEMPLATE/BUG.md +++ b/.github/ISSUE_TEMPLATE/BUG.md @@ -3,48 +3,33 @@ name: 🐛 Bug Report about: Something went awry and you'd like to tell us about it. --- - + - If you remove or skip this template, you'll make the 🐼 sad and the mighty god - of Github will appear and pile-drive the close button from a great height - while making animal noises. +### Bug report - 👉🏽 Need support, advice, or help? Don't open an issue! - Head to StackOverflow or https://gitter.im/webpack/webpack. ---> - -- Operating System: -- Node Version: -- NPM Version: -- webpack Version: -- mini-css-extract-plugin Version: - -### Expected Behavior - - + + + + + ### Actual Behavior - - -### Code + -```js -// webpack.config.js -// If your code blocks are over 20 lines, please paste a link to a gist -// (https://gist.github.com). -``` +### Expected Behavior -```js -// additional code, HEY YO remove this block if you don't need it -``` + + ### How Do We Reproduce? - + + + + + - If your webpack config is over 50 lines long, please provide a URL to a repo - for your beefy 🍖 app that we can use to reproduce. ---> +### Please paste the results of `npx webpack-cli info` here, and mention other relevant information diff --git a/.github/ISSUE_TEMPLATE/DOCS.md b/.github/ISSUE_TEMPLATE/DOCS.md index 88d05ddd..0db304fa 100644 --- a/.github/ISSUE_TEMPLATE/DOCS.md +++ b/.github/ISSUE_TEMPLATE/DOCS.md @@ -3,16 +3,8 @@ name: 📚 Documentation about: Are the docs lacking or missing something? Do they need some new 🔥 hotness? Tell us here. --- - + + Documentation Is: @@ -25,4 +17,10 @@ Documentation Is: ### Please Explain in Detail... + + + + + + ### Your Proposal for Changes diff --git a/.github/ISSUE_TEMPLATE/FEATURE.md b/.github/ISSUE_TEMPLATE/FEATURE.md index d7cae649..f844ab92 100644 --- a/.github/ISSUE_TEMPLATE/FEATURE.md +++ b/.github/ISSUE_TEMPLATE/FEATURE.md @@ -3,23 +3,17 @@ name: ✨ Feature Request about: Suggest an idea for this project --- - - -- Operating System: -- Node Version: -- NPM Version: -- webpack Version: -- mini-css-extract-plugin Version: + + ### Feature Proposal + + + + + + ### Feature Use Case + +### Please paste the results of `npx webpack-cli info` here, and mention other relevant information diff --git a/.github/ISSUE_TEMPLATE/MODIFICATION.md b/.github/ISSUE_TEMPLATE/MODIFICATION.md index f08d0929..5f264c3b 100644 --- a/.github/ISSUE_TEMPLATE/MODIFICATION.md +++ b/.github/ISSUE_TEMPLATE/MODIFICATION.md @@ -3,25 +3,19 @@ name: 🔧 Modification Request about: Would you like something work differently? Have an alternative approach? This is the template for you. --- - + - If you remove or skip this template, you'll make the 🐼 sad and the mighty god - of Github will appear and pile-drive the close button from a great height - while making animal noises. - - 👉🏽 Need support, advice, or help? Don't open an issue! - Head to StackOverflow or https://gitter.im/webpack/webpack. ---> +### Modification Proposal -- Operating System: -- Node Version: -- NPM Version: -- webpack Version: -- mini-css-extract-plugin Version: + + + + + ### Expected Behavior / Situation ### Actual Behavior / Situation -### Modification Proposal +### Please paste the results of `npx webpack-cli info` here, and mention other relevant information diff --git a/.github/ISSUE_TEMPLATE/SUPPORT.md b/.github/ISSUE_TEMPLATE/SUPPORT.md index 558934ac..600bf0b2 100644 --- a/.github/ISSUE_TEMPLATE/SUPPORT.md +++ b/.github/ISSUE_TEMPLATE/SUPPORT.md @@ -1,8 +1,8 @@ --- name: 🆘 Support, Help, and Advice -about: 👉🏽 Need support, help, or advice? Don't open an issue! Head to StackOverflow or https://gitter.im/webpack/webpack. +about: 👉🏽 Need support, help, or advice? Don't open an issue! Head to https://github.com/webpack/webpack/discussions, StackOverflow or https://gitter.im/webpack/webpack. --- Hey there! If you need support, help, or advice then this is not the place to ask. -Please visit [StackOverflow](https://stackoverflow.com/questions/tagged/webpack) +Please visit [Discussions](https://github.com/webpack/webpack/discussions), [StackOverflow](https://stackoverflow.com/questions/tagged/webpack) or [the Webpack Gitter](https://gitter.im/webpack/webpack) instead. diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml new file mode 100644 index 00000000..9fb6d03f --- /dev/null +++ b/.github/workflows/cancel.yml @@ -0,0 +1,23 @@ +name: Cancel +on: + push: + branches: + - master + - next + pull_request: + branches: + - master + - next +permissions: {} # none +jobs: + cancel: + permissions: + actions: write + name: Cancel Previous Runs + runs-on: ubuntu-latest + timeout-minutes: 3 + steps: + - uses: styfle/cancel-workflow-action@0.11.0 + with: + workflow_id: nodejs.yml + access_token: ${{ github.token }} diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml new file mode 100644 index 00000000..745f4c5e --- /dev/null +++ b/.github/workflows/dependency-review.yml @@ -0,0 +1,14 @@ +name: "Dependency Review" +on: [pull_request] + +permissions: + contents: read + +jobs: + dependency-review: + runs-on: ubuntu-latest + steps: + - name: "Checkout Repository" + uses: actions/checkout@v3 + - name: "Dependency Review" + uses: actions/dependency-review-action@v2 diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 8cf96662..ccadd5b2 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -10,6 +10,9 @@ on: - master - next +permissions: + contents: read + jobs: lint: name: Lint - ${{ matrix.os }} - Node v${{ matrix.node-version }} @@ -20,22 +23,20 @@ jobs: strategy: matrix: os: [ubuntu-latest] - node-version: [12.x] + node-version: [16.x] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Use Node.js ${{ env.node-version }} - uses: actions/setup-node@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 with: - node-version: ${{ env.node-version }} - - - name: Use latest NPM - run: sudo npm i -g npm + node-version: ${{ matrix.node-version }} + cache: "npm" - name: Install dependencies run: npm ci @@ -43,11 +44,17 @@ jobs: - name: Lint run: npm run lint - # - name: Security audit - # run: npm run security + - name: Build types + run: npm run build:types + + - name: Check types + run: if [ -n "$(git status types --porcelain)" ]; then echo "Missing types. Update types by running 'npm run build:types'"; exit 1; else echo "All types are valid"; fi + + - name: Security audit + run: npm run security - name: Check commit message - uses: wagoid/commitlint-github-action@v1 + uses: wagoid/commitlint-github-action@v5 test: name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }} @@ -55,9 +62,8 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - # css-loader doesn't support node@6 - node-version: [10.x, 12.x, 14.x] - webpack-version: [latest, next] + node-version: [12.x, 14.x, 16.x, 18.x, 19.x] + webpack-version: [latest] runs-on: ${{ matrix.os }} @@ -66,25 +72,19 @@ jobs: if: matrix.os == 'windows-latest' run: git config --global core.autocrlf input - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - - name: Use latest NPM on ubuntu/macos - if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' - run: sudo npm i -g npm - - - name: Use latest NPM on windows - if: matrix.os == 'windows-latest' - run: npm i -g npm + cache: "npm" - name: Install dependencies run: npm i - name: Install webpack ${{ matrix.webpack-version }} + if: matrix.webpack-version != 'latest' run: npm i webpack@${{ matrix.webpack-version }} - name: Run tests for webpack version ${{ matrix.webpack-version }} @@ -94,3 +94,39 @@ jobs: uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} + + test-old-api: + name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack latest, old API + + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + node-version: [12.x, 14.x, 16.x, 18.x] + + runs-on: ${{ matrix.os }} + + steps: + - name: Setup Git + if: matrix.os == 'windows-latest' + run: git config --global core.autocrlf input + + - uses: actions/checkout@v3 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: "npm" + + - name: Install dependencies + run: npm i + + - name: Run tests for webpack version latest with experimentalUseImportModule + run: npm run test:coverage -- --ci + env: + OLD_API: "true" + + - name: Submit coverage data to codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index 5c45b95b..506b2a57 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ npm-debug.log* /dist /test/js /test/outputs +/test/manual/dist /local /reports /node_modules diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 00000000..e8511eae --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install commitlint --edit $1 diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..d37daa07 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install lint-staged diff --git a/.prettierignore b/.prettierignore index 41ff7724..d9dd09e9 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,6 +2,7 @@ /dist /node_modules /test/fixtures +/test/manual/dist /test/cases/*/expected /test/js CHANGELOG.md diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index 1934550a..00000000 --- a/.prettierrc.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - singleQuote: true, - trailingComma: 'es5', - arrowParens: 'always', -}; diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d112a54..3e0b35c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,416 @@ 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.7.2](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.7.1...v2.7.2) (2022-12-06) + + +### Bug Fixes + +* don't crash in web workers ([#1004](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/1004)) ([4d98d4b](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/4d98d4b973be27910b84194e6f7acb1d09f1e8ae)) + +### [2.7.1](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.7.0...v2.7.1) (2022-11-29) + + +### Bug Fixes + +* preserve order of link tags on HMR ([#982](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/982)) ([6ea0922](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/6ea092258944fd0330b84dd3455bff9a15320837)) + +## [2.7.0](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.6.1...v2.7.0) (2022-11-16) + + +### Features + +* add function support for locals (loader) ([#985](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/985)) ([65519d0](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/65519d0701b3c5d60585468b8220159cbbfbe6b8)) + +### [2.6.1](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.6.0...v2.6.1) (2022-06-15) + + +### Bug Fixes + +* do not attempt hot reloading when emit is false ([#953](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/953)) ([b426f04](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/b426f04961846991e8ca671c6a4d48e6a83a46c2)) + +## [2.6.0](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.5.3...v2.6.0) (2022-03-03) + + +### Features + +* added `baseUri` option support (from entry options) ([#915](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/915)) ([6004d95](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/6004d95cad2d18d9d080d913db7dc48f16bf888c)) + +### [2.5.3](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.5.2...v2.5.3) (2022-01-25) + + +### Bug Fixes + +* types ([#903](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/903)) ([6650691](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/6650691f7e6a45004779566c909a0e48e9d67f04)) + +### [2.5.2](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.5.1...v2.5.2) (2022-01-17) + + +### Bug Fixes + +* types ([dfb9afd](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/dfb9afdfb2ea6c816d6d4986fbb382dac300e7ea)) + +### [2.5.1](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.5.0...v2.5.1) (2022-01-17) + + +### Bug Fixes + +* cjs export and types ([e836a00](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/e836a00cb164fecdb49e670e0552475477fa7994)) + +## [2.5.0](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.4.7...v2.5.0) (2022-01-14) + + +### Features + +* added types ([5b5654c](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/5b5654c9847a615555660d79245b857536f72124)) + +### [2.4.7](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.4.6...v2.4.7) (2022-01-13) + + +### Bug Fixes + +* multiple serializer registrations ([#894](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/894)) ([c784204](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/c784204772538ab8984e1c25e4501a7602b41ad1)) + +### [2.4.6](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.4.5...v2.4.6) (2022-01-06) + + +### Bug Fixes + +* crash when `publicPath` is function ([#881](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/881)) ([41bd828](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/41bd828ba11baf2c1349b3a8103072e2d82fd4c2)) +* do not allow absolute path in the `chunkFilename` option ([#879](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/879)) ([36e04ab](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/36e04ab8b5e55d429ce361841e77f6ddba934ee1)) +* do not allow absolute path in the `filename` option ([#878](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/878)) ([76361df](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/76361df4220f62c18b3660af76ab8b28c56d0471)) + +### [2.4.5](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.4.4...v2.4.5) (2021-11-17) + +### Chore + +* update `schema-utils` package to `4.0.0` version + +### [2.4.4](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.4.3...v2.4.4) (2021-11-04) + + +### Bug Fixes + +* crash with `[contenthash]` ([#869](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/869)) ([57ad127](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/57ad1274328512aebb20fa3b2c27fb9321f835a7)) +* runtime path in modules without context ([#866](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/866)) ([e2e30b2](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/e2e30b280d51f313e3ac566af3b839e580b22ef5)) + +### [2.4.3](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.4.2...v2.4.3) (2021-10-21) + + +### Bug Fixes + +* small perf improvement ([#860](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/860)) ([8c4846b](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/8c4846b3a55770cb7286b1f092e619204503ed7f)) + +### [2.4.2](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.4.1...v2.4.2) (2021-10-07) + + +### Bug Fixes + +* endless apply of loaders, leading to memory allocation failure ([#849](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/849)) ([94ad699](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/94ad699baa1805a0646e7db1d69eb5997df6c8db)) + +### [2.4.1](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.4.0...v2.4.1) (2021-10-05) + + +### Bug Fixes + +* crash with multiple webpack versions ([#845](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/845)) ([b4431cb](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/b4431cb60a6eadcf8c2b614f494faf899c73aaa0)) + +## [2.4.0](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.3.0...v2.4.0) (2021-10-05) + +### Performance + +* migrate on new API, this improves performance and memory usage a lot, you need to have at least webpack `5.52.0` (recommended latest stable), for older versions the old API will be used (except explicit enabling of the `experimentalUseImportModule` option) + + +### Features + +* added support for `supports()` and `layer()` in `@import` at-rule ([#843](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/843)) ([e751080](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/e751080ad6a81f196d5c26fb79b3c69b9429a634)) + + +### Bug Fixes + +* crash with the `exportLocalsConvention` option ([#844](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/844)) ([0f8d501](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/0f8d5015c95724b537ddc627758f67020d01ae0b)) + +## [2.3.0](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.2.2...v2.3.0) (2021-09-11) + + +### Features + +* added the `runtime` option ([#831](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/831)) ([5cc73e6](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/5cc73e6b590632263fc6ea0a830df1322520c2f4)) + + +### Bug Fixes + +* better description for async chunk options ([34b65ac](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/34b65ac4daea5a977a75846b159becbc2ebb0632)) + +### [2.2.2](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.2.1...v2.2.2) (2021-09-01) + + +### Bug Fixes + +* `experimentalUseImportModule` works with `new URL(...)` syntax ([cf81c4b](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/cf81c4b9962e74d666f6bb7d6473a9b6c06936cd)) + +### [2.2.1](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.2.0...v2.2.1) (2021-08-31) + + +### Bug Fixes + +* order of `@import` with the `output.pathinfo` option ([#815](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/815)) ([831f771](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/831f771b3c5e59978dbc53f1ccc90e23a9e30e9b)) +* source map generation with the `output.pathinfo` option ([#817](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/817)) ([f813b4c](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/f813b4c7b72383b8777da74b90830be20db6a483)) + +## [2.2.0](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.0.0...v2.2.0) (2021-08-04) + + +### Features + +* add `link` and `description` for options ([#786](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/786)) ([3c5a5b7](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/3c5a5b7aba8ed855368a7e95d89420b97dcd1531)) + + +### Bug Fixes + +* hmr in browser extension ([3d09da1](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/3d09da1abb9250b39c6a15efd33950aa19efb0b3)) + +## [2.1.0](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.0.0...v2.1.0) (2021-07-05) + + +### Features + +* support the `pathinfo` option ([#783](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/783)) ([a37713f](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/a37713f53bcecb9efc3f8a4d389c6274dae0bc85)) + +## [2.0.0](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.6.2...v2.0.0) (2021-06-30) + +### NOTES + +In the current release we have fixed many problems with `publicPath`, previously to generate relative URLs inside CSS files developers use different hacks: `publicPath: ''`, `publicPath: '../'`, using relative `../../` in the `outputPath` option for `file-loader` and etc. Now you don't need it anymore. Webpack v5 uses `publicPath: "auto"` by default, which means to always generate relative URLs, and now `mini-css-extract-plugin` does the same. + +**We strongly recommend use `auto` value by default (except when using CDN).** + +**We also want to show you that the [`file-loader`](https://github.com/webpack-contrib/file-loader) and [`url-loader`](https://github.com/webpack-contrib/url-loader) are outdated, please migrate on [Asset Modules](https://webpack.js.org/guides/asset-modules/).** + +### ⚠ 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`, just remove it +* the `publicPath` option no longer automatically adds `/` (trailing slash), you need to specify, you need to specify it yourself if it is absent, i.e. if you have `publicPath: "/my/public/path"` replace it with `publicPath: "/my/public/path/"` + +### Bug Fixes + +* generating correct relative `url()` for assets inside CSS files when you use `publicPath: "auto"` (default value) + + +### [1.6.2](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.6.1...v1.6.2) (2021-06-28) + +### Bug Fixes + +* performance improvement + +### [1.6.1](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.6.0...v1.6.1) (2021-06-25) + + +### Bug Fixes + +* memory leaks ([c68aca7](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/c68aca7c58b1bfb3d3f9f8db70fd814e50f82aa1)) + +## [1.6.0](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.5.1...v1.6.0) (2021-04-30) + + +### Features + +* added new url support ([#753](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/753)) ([c76a1a1](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/c76a1a16b926e3dc8f6763d940ab6e4eb170c77f)) + +### [1.5.1](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.5.0...v1.5.1) (2021-04-28) + + +### Bug Fixes + +* compatibility with named export and es5 ([#751](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/751)) ([3be81bb](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/3be81bb4e795fc9295c2c7e7a8bb71de9cead2d0)) + +## [1.5.0](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.4.1...v1.5.0) (2021-04-17) + + +### Features + +* add experimental support for `importModule`, improve perfomance ([#737](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/737)) ([8471ac2](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/8471ac24dde3d7e874995f8ab4814cc94b4179e1)) + +### [1.4.1](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.4.0...v1.4.1) (2021-04-07) + + +### Bug Fixes + +* ES5 compatibility ([43e081f](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/43e081f3a2767f3c00a29349a71ad17eca9cc168)) + +## [1.4.0](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.3.9...v1.4.0) (2021-03-26) + + +### Features + +* added the `emit` option for SSR ([#732](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/732)) ([03b4293](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/03b4293023e85e89abf46a2e42d61ec8684cb318)) + +### [1.3.9](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.3.8...v1.3.9) (2021-02-25) + + +### Bug Fixes + +* allow consumers to access `CssModule` and `CssDependency` ([#703](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/703)) ([6484345](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/64843452a7c07963637a749bce9628d808694eac)) +* allow to use `auto` value with the `publicPath` option ([#709](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/709)) ([1be21d2](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/1be21d29053c32cfec26eb58aa5deabd65069c71)) + +### [1.3.8](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.3.7...v1.3.8) (2021-02-18) + + +### Bug Fixes + +* deterministic `[contenthash]` ([#702](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/702)) ([2ff8e59](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/2ff8e592e13d54dc87fad4fcf5065136d4610dca)) + +### [1.3.7](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.3.6...v1.3.7) (2021-02-15) + + +### Bug Fixes + +* compatibility with webpack v5 ([9b6b8b3](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/9b6b8b3a8393a62b7b7a3b38c0c52b694ed51e19)) + +### [1.3.6](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.3.5...v1.3.6) (2021-02-08) + + +### Bug Fixes + +* do not crash on using `[fullhash]` ([#695](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/695)) ([dbb708c](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/dbb708cf181d8f3d69af11cc15f959f187e38ffa)) + +### [1.3.5](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.3.4...v1.3.5) (2021-01-28) + + +### Bug Fixes + +* bloated runtime ([#687](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/687)) ([70ce174](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/70ce174941016174bb82ff46c808593a1e1b7e1e)) +* hmr runtime on preloaded stylesheet link ([#686](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/686)) ([05e2951](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/05e29514952bf3ff3f30ec33c4bda66999d8486b)) +* yarn pnp compatibility ([#688](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/688)) ([05b188a](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/05b188a055ee6663f8d307e99b22c51200fee320)) + +### [1.3.4](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.3.3...v1.3.4) (2021-01-13) + + +### Bug Fixes + +* `identifier` for `CssModule` ([#677](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/677)) ([117a97a](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/117a97acaa5b37c5183b5b48264d7e524e8f5bc3)) + +### [1.3.3](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.3.2...v1.3.3) (2020-12-10) + + +### Bug Fixes + +* serializing big strings in sourceMap ([#665](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/665)) ([f7a5e53](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/f7a5e5381ce1d2b822d49b688027d06efec2312d)) + +### [1.3.2](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.3.1...v1.3.2) (2020-12-04) + + +### Bug Fixes + +* missing auxiliary assets ([#662](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/662)) ([f28c1e1](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/f28c1e115fb9aacbd87e3b1540adb7418a4cc375)) + +### [1.3.1](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.3.0...v1.3.1) (2020-11-12) + + +### Bug Fixes + +* compatibility with asset modules ([#656](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/656)) ([bea1f4d](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/bea1f4d0c25abc6268b8076305e9879344ff1701)) + +## [1.3.0](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.2.1...v1.3.0) (2020-11-06) + + +### ⚠ POTENTIAL BREAKING CHANGE + +Options are now validated according to stricter rules - no unknown additional properties. For example, if you have not removed the `hmr` option for the loader when migrating to `mini-css-extract-plugin@1`, you will get an error. Just remove them from your configuration(s). We did this because many developers started making these mistakes. + +### Features + +* added the `type` property for loading errors ([#651](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/651)) ([be9ddcb](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/be9ddcba7f4b216aa52dcd64a0e450a312b7156f)) + + +### Bug Fixes + +* schema ([#652](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/652)) ([4e4733d](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/4e4733dc10fd8a8ecda5b47421b390a479b826aa)) +* serializing big strings ([#647](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/647)) ([022d945](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/022d9459a6f158166e700c11a02b9063154c96bc)) +* source map url for devtool (only webpack@5) ([#650](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/650)) ([5889d43](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/5889d43bafe8613a29e3a8156f0b5052b6ad88b9)) + +### [1.2.1](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.2.0...v1.2.1) (2020-10-27) + + +### Bug Fixes + +* onerror/onload memory leak ([#640](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/640)) ([2b6fcf2](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/2b6fcf260b2fb13afe2abd052cff5dea184ef398)) + +## [1.2.0](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.1.2...v1.2.0) (2020-10-23) + + +### Features + +* added the `linkType` option ([#634](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/634)) ([a89c0f9](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/a89c0f982716d1093dbe6b12de47e4e8df1543f5)) + + +### Bug Fixes + +* compatibility with webpack@4 and webpack@5 for monorepos ([#638](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/638)) ([60c3eef](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/60c3eef936245183451d63f1e080ce990553078d)) + +### [1.1.2](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.1.0...v1.1.2) (2020-10-22) + + +### Bug Fixes + +* compatibility with webpack@4 and webpack@5 for monorepos ([#636](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/636)) ([3413439](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/341343924d96f5d0076f27b98c96f9439bff6347)) +* error when reloading async chunk ([#633](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/633)) ([89e7a0a](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/89e7a0acf08f36711c916a4827ea6afff7028afb)) + +### [1.1.1](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.1.0...v1.1.1) (2020-10-20) + + +### Bug Fixes + +* fix `onerror` message for async chunks ([#629](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/629)) ([883079e](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/883079e02b9d400fab4e8a955604036a3be50c48)) + +## [1.1.0](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.0.0...v1.1.0) (2020-10-19) + + +### Features + +* added the `attributes` option ([e8a2d5a](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/e8a2d5a09ded967e0f4be145f1f52c1e5f7f6df1)) +* added the `insert` option ([a5f17c4](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/a5f17c48cbf0c198ebc955032d11593434ef2373)) + + +### Bug Fixes + +* ignore modules without identifier ([#627](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/627)) ([71a9ce9](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/71a9ce91b377fff892068b87445372fe1c2db142)) +* remove `normalize-url` from deps ([#623](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/623)) ([9ae47e5](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/9ae47e51f198f2e0258d0e87d6e708e57c05bf86)) + +### [1.0.0](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v0.12.0...v1.0.0) (2020-10-09) + +### BREAKING CHANGE + +* minimum supported `Node.js` version is `10.13.0` +* the `esModule` option is `true` by default, you need to change `const locals = require('./styles.css')`/`require('./styles.css')` on `import locals from './styles.css'`/`import './styles.css''` +* the `moduleFilename` option was removed in favor the `filename` option +* the `hmr` option was removed, HMR will work automatically when `HotModuleReplacement` plugin used or `webpack-dev-server` with enabled the `hot` option +* the `reloadAll` was removed + +### Features + +- the `chunkFilename` option can be a function for webpack@5 + +### ⚠ NOTICE + +To avoid problems between `mini-css-extract-plugin` and `style-loader` because of changing the `esModule` option to `true` by default we strongly recommend upgrading `style-loader` to `2.0.0` version. + +### [0.12.0](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v0.11.3...v0.12.0) (2020-10-07) + + +### Features + +* opt-in to transitive only side effects (webpack@5), no more empty JS chunks + +### [0.11.3](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v0.11.2...v0.11.3) (2020-10-02) + + +### Bug Fixes + +* better support for webpack 5 ([#595](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/595)) ([6e09a51](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/6e09a51954aee1c8db904747e0b9bc42d14e7b47)) + ### [0.11.2](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v0.11.1...v0.11.2) (2020-09-12) diff --git a/README.md b/README.md index 825554ab..d536b95b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@