Skip to content

Commit

Permalink
Merge forked v2.7.6 with changes to v2.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
FogelAI committed Mar 12, 2024
2 parents b785fd8 + 717acf1 commit c10b21b
Show file tree
Hide file tree
Showing 53 changed files with 5,920 additions and 4,372 deletions.
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"vspace",
"commitlint",
"unreload",
"cnfg"
"cnfg",
"tapable"
],

"ignorePaths": [
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout Repository"
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: "Dependency Review"
uses: actions/dependency-review-action@v3
uses: actions/dependency-review-action@v4
21 changes: 11 additions & 10 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ jobs:
cancel-in-progress: true

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
Expand All @@ -57,8 +57,9 @@ jobs:
- name: Security audit
run: npm run security

- name: Check commit message
uses: wagoid/commitlint-github-action@v5
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose

test:
name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }}
Expand All @@ -80,10 +81,10 @@ jobs:
if: matrix.os == 'windows-latest'
run: git config --global core.autocrlf input

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
Expand All @@ -99,7 +100,7 @@ jobs:
run: npm run test:coverage -- --ci

- name: Submit coverage data to codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -118,10 +119,10 @@ jobs:
if: matrix.os == 'windows-latest'
run: git config --global core.autocrlf input

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
Expand All @@ -135,6 +136,6 @@ jobs:
OLD_API: "true"

- name: Submit coverage data to codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@

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.8.1](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.8.0...v2.8.1) (2024-02-27)


### Bug Fixes

* add `nonce` if `__webpack_nonce__` has been defined ([c7f0aee](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/c7f0aee5feaa1b8d047f575e94a91662eb8c314c))

## [2.8.0](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.7.7...v2.8.0) (2024-02-01)


### Features

* added the `beforeTagInsert` hook ([#1054](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/1054)) ([6313bf6](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/6313bf629c1c76ec7b07dc60fef06e39702a63d9))
* support named exports with any characters ([b656c5c](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/b656c5c98dcffcae51f5208e961ce089be6607a8))

### [2.7.7](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.7.6...v2.7.7) (2024-01-10)


### Bug Fixes

* add ';' to import media queries ([#1051](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/1051)) ([98acf2b](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/98acf2bbd08ba0988318c6d364b9aa14f84ed79a))
* add `ChunkLoadError` name to chunk loading error ([#1073](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/1073)) ([e3f8375](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/e3f837574bdad9dc583028c6f9a9a2f3082d9ecb))
* adding media, supports and layer for external import ([#1072](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/1072)) ([60c5331](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/60c53311c125425d2e742414ed6dbd59cea8cbe4))
* css experiment detection ([#1067](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/1067)) ([82f4a47](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/82f4a47f3ddc7cdbba311bee50d85dd4b3e6bfb1))

### [2.7.6](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.7.5...v2.7.6) (2023-05-19)


Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,27 @@ If you'd like to extract the media queries from the extracted CSS (so mobile use
- [Media Query Plugin](https://github.com/SassNinja/media-query-plugin)
- [Media Query Splitting Plugin](https://github.com/mike-diamond/media-query-splitting-plugin)

## Hooks

The mini-css-extract-plugin provides hooks to extend it to your needs.

### beforeTagInsert

`SyncWaterfallHook`

Called before inject the insert code for link tag. Should return a string

```javascript
MiniCssExtractPlugin.getCompilationHooks(compilation).beforeTagInsert.tap(
"changeHref",
(source, varNames) =>
Template.asString([
source,
`${varNames.tag}.setAttribute("href", "https://github.com/webpack-contrib/mini-css-extract-plugin");`,
])
);
```

## Contributing

Please take a moment to read our contributing guidelines if you haven't yet done so.
Expand Down
Loading

0 comments on commit c10b21b

Please sign in to comment.