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

chore(deps): update dependency style-loader to v4 #401

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 19, 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: 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 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 review from abdullah-cognite, polomani and a team as code owners June 19, 2024 10:30
@renovate renovate bot added dependencies Pull requests that update a dependency file renovate labels Jun 19, 2024
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 7 times, most recently from 26525c3 to 88d7d2f Compare June 26, 2024 04:20
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 6 times, most recently from 290fe70 to 8367afe Compare July 3, 2024 03:17
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 9 times, most recently from 1357672 to e0c3be8 Compare July 10, 2024 12:53
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from e0c3be8 to e518697 Compare July 11, 2024 21:21
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from e518697 to 697a3e7 Compare July 19, 2024 11:08
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 9 times, most recently from 2334cc9 to 73e1618 Compare July 31, 2024 19:46
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 5 times, most recently from c4bd9e5 to c95a6cc Compare August 5, 2024 21:16
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch 11 times, most recently from 7ffef68 to 5aadf67 Compare September 4, 2024 12:30
@renovate renovate bot requested a review from a team as a code owner September 27, 2024 11:51
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from e0d1e53 to d15a578 Compare October 22, 2024 11:00
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from d15a578 to 593dc06 Compare November 7, 2024 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file renovate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant