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: v3.3.3
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.3.4
Choose a head ref
  • 10 commits
  • 12 files changed
  • 3 contributors

Commits on Jun 2, 2023

  1. Verified

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

Commits on Jun 4, 2023

  1. Verified

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

Commits on Sep 12, 2023

  1. Verified

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

Commits on Dec 5, 2023

  1. Verified

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

Commits on Jan 9, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    14e731e View commit details
  2. Copy the full SHA
    c4b80b4 View commit details
  3. Copy the full SHA
    43cdf2b View commit details
  4. Copy the full SHA
    337e730 View commit details
  5. Copy the full SHA
    c12e70b View commit details
  6. Copy the full SHA
    bfdc1fc View commit details
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/BUG.md
Original file line number Diff line number Diff line change
@@ -8,10 +8,9 @@ about: Something went awry and you'd like to tell us about it.

### Bug report

<!-- Please ask questions on discussions, StackOverflow or the webpack Gitter. -->
<!-- Please ask questions on discussions or StackOverflow. -->
<!-- https://github.com/webpack/webpack/discussions -->
<!-- https://stackoverflow.com/questions/ask?tags=webpack -->
<!-- https://gitter.im/webpack/webpack -->
<!-- Issues which contain questions or support requests will be closed. -->

### Actual Behavior
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/DOCS.md
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@ Documentation Is:
<!-- Please don't delete this template otherwise your issue will be closed immediately -->
<!-- https://github.com/webpack/webpack/discussions -->
<!-- https://stackoverflow.com/questions/ask?tags=webpack -->
<!-- https://gitter.im/webpack/webpack -->
<!-- Issues which contain questions or support requests will be closed. -->

### Your Proposal for Changes
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/FEATURE.md
Original file line number Diff line number Diff line change
@@ -8,10 +8,9 @@ about: Suggest an idea for this project

### Feature Proposal

<!-- Please ask questions on discussions, StackOverflow or the webpack Gitter. -->
<!-- Please ask questions on discussions or StackOverflow. -->
<!-- https://github.com/webpack/webpack/discussions -->
<!-- https://stackoverflow.com/questions/ask?tags=webpack -->
<!-- https://gitter.im/webpack/webpack -->
<!-- Issues which contain questions or support requests will be closed. -->

### Feature Use Case
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/MODIFICATION.md
Original file line number Diff line number Diff line change
@@ -8,10 +8,9 @@ about: Would you like something work differently? Have an alternative approach?

### Modification Proposal

<!-- Please ask questions on discussions, StackOverflow or the webpack Gitter. -->
<!-- Please ask questions on discussions or StackOverflow. -->
<!-- https://github.com/webpack/webpack/discussions -->
<!-- https://stackoverflow.com/questions/ask?tags=webpack -->
<!-- https://gitter.im/webpack/webpack -->
<!-- Issues which contain questions or support requests will be closed. -->

### Expected Behavior / Situation
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -4,5 +4,4 @@ about: 👉🏽 Need support, help, or advice? Don't open an issue! Head to http
---

Hey there! If you need support, help, or advice then this is not the place to ask.
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.
Please visit [GitHub Discussions](https://github.com/webpack/webpack/discussions) or [StackOverflow](https://stackoverflow.com/questions/tagged/webpack) instead.
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -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"
@@ -74,10 +74,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"
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,13 @@

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.3.4](https://github.com/webpack-contrib/style-loader/compare/v3.3.3...v3.3.4) (2024-01-09)


### Bug Fixes

* css experiments logic ([c12e70b](https://github.com/webpack-contrib/style-loader/commit/c12e70bc8592d891adb5c0f5ae0ec19fb2698dbb))

### [3.3.3](https://github.com/webpack-contrib/style-loader/compare/v3.3.2...v3.3.3) (2023-05-19)


6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -70,6 +70,10 @@ module.exports = {
};
```

## Security Warning

This loader is primarily meant for development. The default settings are not safe for production environments. See the [recommended example configuration](#recommended) and the section on [nonces](#nonce) for details.

## Options

- [**`injectType`**](#injecttype)
@@ -964,6 +968,8 @@ module.exports = {

### Nonce

If you are using a [Content Security Policy](https://www.w3.org/TR/CSP3/) (CSP), the injected code will usually be blocked. A workaround is to use a nonce. Note, however, that using a nonce significantly reduces the protection provided by the CSP. You can read more about the security impact in [the specification](https://www.w3.org/TR/CSP3/#security-considerations). The better solution is not to use this loader in production.

There are two ways to work with `nonce`:

- using the `attributes` option
21,778 changes: 3,020 additions & 18,758 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "style-loader",
"version": "3.3.3",
"version": "3.3.4",
"description": "style loader module for webpack",
"license": "MIT",
"repository": "webpack-contrib/style-loader",
@@ -48,19 +48,19 @@
},
"devDependencies": {
"@babel/cli": "^7.21.5",
"@babel/core": "^7.21.5",
"@babel/preset-env": "^7.21.5",
"@babel/core": "^7.22.1",
"@babel/preset-env": "^7.22.4",
"@commitlint/cli": "^16.3.0",
"@commitlint/config-conventional": "^16.2.4",
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
"babel-jest": "^28.1.3",
"cross-env": "^7.0.3",
"cspell": "^6.31.1",
"css-loader": "^6.7.4",
"css-loader": "^6.8.1",
"del": "^6.1.1",
"del-cli": "^4.0.1",
"es-check": "^7.1.1",
"eslint": "^8.39.0",
"eslint": "^8.41.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"file-loader": "^6.2.0",
@@ -74,11 +74,11 @@
"prettier": "^2.8.8",
"sass": "^1.62.1",
"sass-loader": "^12.4.0",
"semver": "^7.5.0",
"semver": "^7.5.1",
"standard-version": "^9.5.0",
"webpack": "^5.83.1",
"webpack": "^5.85.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.13.3"
"webpack-dev-server": "^4.15.0"
},
"keywords": [
"webpack"
10 changes: 8 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -30,7 +30,10 @@ const loader = function loader(content) {
this._compiler.options.experiments &&
this._compiler.options.experiments.css &&
this._module &&
this._module.type === "css"
(this._module.type === "css" ||
this._module.type === "css/global" ||
this._module.type === "css/module" ||
this._module.type === "css/auto")
) {
return content;
}
@@ -43,7 +46,10 @@ loader.pitch = function pitch(request) {
this._compiler.options.experiments &&
this._compiler.options.experiments.css &&
this._module &&
this._module.type === "css"
(this._module.type === "css" ||
this._module.type === "css/global" ||
this._module.type === "css/module" ||
this._module.type === "css/auto")
) {
this.emitWarning(
new Error(