Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Apr 8, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
style-loader ^3.3.1 -> ^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: function (css, style) {
                // Do something ...
                style.innerHTML = `${css}.modify{}\n`;

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

After:

insert-function.js

function insert(css, style) {
  var 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: function (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 - At any time (no schedule defined), Automerge - At any time (no schedule defined).

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

Rebasing: Whenever PR becomes conflicted, 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 has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 9 times, most recently from 37bc0c4 to a3edf3e Compare April 16, 2024 22:58
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 6 times, most recently from edb1bdc to 336f89c Compare April 24, 2024 03:51
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 2 times, most recently from a788f11 to 77c586d Compare May 6, 2024 03:16
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 5 times, most recently from 4a3d99f to b9b325e Compare May 13, 2024 04:10
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from b9b325e to e250d1a Compare May 27, 2024 05:13
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from e250d1a to b159c10 Compare May 31, 2024 12:13
@leonard84 leonard84 enabled auto-merge May 31, 2024 12:15
@leonard84 leonard84 added this pull request to the merge queue May 31, 2024
Merged via the queue into main with commit bcf6c7f May 31, 2024
@leonard84 leonard84 deleted the renovate/style-loader-4.x branch May 31, 2024 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants