Skip to content

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 12, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
style-loader 3.3.4 -> 4.0.0 age adoption passing confidence

Release Notes

webpack-contrib/style-loader (style-loader)

v4.0.0

Compare Source

⚠ BREAKING CHANGES
  • minimum supported webpack version is 5.27.0
  • minimum support Node.js version is 18.12.0
  • the insert option can only be a selector or the path to the module

Migration:

Before:

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/i,
        use: [
          {
            loader: "style-loader",
            options: {
              injectType: "styleTag",
              styleTagTransform (css, style) {
                // Do something ...
                style.innerHTML = `${css}.modify{}\n`;

                document.head.appendChild(style);
              },
            },
          },
          "css-loader",
        ],
      },
    ],
  },
};

After:

insert-function.js

function insert(css, style) {
  const parent = options.target || document.head;

  parent.appendChild(element);
}

module.exports = insert;

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/i,
        use: [
          {
            loader: "style-loader",
            options: {
              insert: require.resolve("./insert.js"),
            },
          },
          "css-loader",
        ],
      },
    ],
  },
};
  • the styleTagTransform option can only be the path to the module

Migration:

Before:

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/i,
        use: [
          {
            loader: "style-loader",
            options: {
              injectType: "styleTag",
              styleTagTransform (css, style) {
                // Do something ...
                style.innerHTML = `${css}.modify{}\n`;

                document.head.appendChild(style);
              },
            },
          },
          "css-loader",
        ],
      },
    ],
  },
};

After:

style-tag-transform-function.js

function styleTagTransform(css, style) {
  // Do something ...
  style.innerHTML = `${css}.modify{}\n`;

  document.head.appendChild(style);
}

module.exports = styleTagTransform;

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/i,
        use: [
          {
            loader: "style-loader",
            options: {
              styleTagTransform: require.resolve("./style-tag-transform-function.js"),
            },
          },
          "css-loader",
        ],
      },
    ],
  },
};
Bug Fixes
3.3.3 (2023-05-19)
Bug Fixes
3.3.2 (2023-03-13)
Bug Fixes
3.3.1 (2021-10-21)
Bug Fixes

Configuration

📅 Schedule: Branch creation - "after 5pm every weekday,every weekend,before 9am every weekday" in timezone America/Los_Angeles, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the type: dependencies Dependency upgrades or downgrades. label Apr 12, 2024
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from 0c0c4d0 to 49b618d Compare April 15, 2024 11:10
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from 49b618d to 6b783c8 Compare April 22, 2024 13:07
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 2 times, most recently from 336ed9d to 99aa22f Compare May 6, 2024 13:35
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from 99aa22f to 6d8ff71 Compare May 13, 2024 09:33
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 2 times, most recently from cb357e1 to 4115f8b Compare June 3, 2024 09:18
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from 4115f8b to 08cf171 Compare June 10, 2024 09:34
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 2 times, most recently from 84bb0e4 to b359860 Compare June 24, 2024 12:10
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from b359860 to a1a4b18 Compare July 1, 2024 09:57
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 2 times, most recently from 83f0004 to 15e48f2 Compare July 15, 2024 10:30
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 12 times, most recently from 56c20ca to 6a44892 Compare July 23, 2024 12:50
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 4 times, most recently from ec898cd to 9e31427 Compare July 29, 2024 13:42
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 4 times, most recently from c8dbf75 to 0de4353 Compare September 9, 2024 12:35
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 4 times, most recently from e5cd3a1 to a941e71 Compare September 23, 2024 09:26
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 5 times, most recently from af17cb8 to 6ba6c05 Compare September 30, 2024 09:34
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 5 times, most recently from 7112dd4 to 1e11686 Compare October 11, 2024 04:08
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 3 times, most recently from 43f61a1 to 6fa5bcc Compare October 14, 2024 09:18
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 6 times, most recently from 3b1b2ca to c05f0f5 Compare October 28, 2024 16:30
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from c05f0f5 to 3f96c39 Compare September 25, 2025 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: dependencies Dependency upgrades or downgrades.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants