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 #2515

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jan 3, 2025

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 - "every weekday" (UTC), 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.

Copy link

vercel bot commented Jan 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tab-manager-v2-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 7, 2025 6:55pm

@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from fe475ca to cd4f90c Compare January 3, 2025 16:58
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from cd4f90c to 59c7254 Compare January 3, 2025 19:25
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from 59c7254 to 24ea029 Compare January 3, 2025 23:58
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from 24ea029 to 16defb8 Compare January 4, 2025 04:24
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from 16defb8 to fcbc37e Compare January 5, 2025 04:40
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from fcbc37e to 9c18e9f Compare January 5, 2025 23:25
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from 9c18e9f to 5287374 Compare January 5, 2025 23:33
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from 5287374 to ca76af3 Compare January 5, 2025 23:54
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from ca76af3 to 95f2a32 Compare January 6, 2025 00:00
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from 95f2a32 to d657d04 Compare January 6, 2025 00:25
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from d657d04 to d0ea214 Compare January 6, 2025 00:53
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from d0ea214 to 127e71c Compare January 6, 2025 02:01
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from 127e71c to acc9f93 Compare January 6, 2025 05:16
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from acc9f93 to 2077d02 Compare January 6, 2025 13:31
@renovate renovate bot force-pushed the renovate/style-loader-4.x branch from f6e6850 to 0fb2e76 Compare January 7, 2025 18:55
@xcv58 xcv58 merged commit 71217f9 into master Jan 7, 2025
11 checks passed
@xcv58 xcv58 deleted the renovate/style-loader-4.x branch January 7, 2025 19:01
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.

1 participant