Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency style-loader to v4 #504

Merged
merged 1 commit into from
Sep 2, 2024
Merged

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Aug 14, 2024

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 - "after 7am and before 11am every weekday" in timezone Europe/London, Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

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 requested a review from a team as a code owner August 14, 2024 06:20
@renovate renovate bot added the dependencies Pull requests that update a dependency file label Aug 14, 2024
@renovate renovate bot requested review from ciaranca, staceywilson and nman-hmcts and removed request for a team August 14, 2024 06:20
@renovate renovate bot enabled auto-merge (rebase) August 14, 2024 06:20
renovate-approve[bot]
renovate-approve bot previously approved these changes Aug 14, 2024
renovate-approve-2[bot]
renovate-approve-2 bot previously approved these changes Aug 14, 2024
renovate-approve-2[bot]
renovate-approve-2 bot previously approved these changes Sep 2, 2024
renovate-approve[bot]
renovate-approve bot previously approved these changes Sep 2, 2024
Copy link
Contributor

Plan Result (stg)

No changes. Your infrastructure matches the configuration.

Copy link
Contributor

Plan Result (prod)

No changes. Your infrastructure matches the configuration.

Copy link
Contributor

Plan Result (sbox)

No changes. Your infrastructure matches the configuration.

@renovate renovate bot merged commit a578e23 into master Sep 2, 2024
5 checks passed
@renovate renovate bot deleted the renovate/style-loader-4.x branch September 2, 2024 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants