Skip to content

Commit 928fa92

Browse files
authored
feat(deps)!: update style-loader to v4 (#7270)
1 parent dddd4dc commit 928fa92

4 files changed

Lines changed: 21 additions & 23 deletions

File tree

.github/renovate.json5

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@
9494
'@rspack/core',
9595
// some loaders still depend on loader-utils v2
9696
'loader-utils',
97-
// major version contains breaking changes
98-
'style-loader',
99-
'http-proxy-middleware',
10097
// Temporary ignore
10198
'less',
10299
'tinyglobby',

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"rspack-manifest-plugin": "5.2.1",
9191
"sirv": "^3.0.2",
9292
"stacktrace-parser": "^0.1.11",
93-
"style-loader": "3.3.4",
93+
"style-loader": "^4.0.0",
9494
"supports-color": "^10.2.2",
9595
"tinyglobby": "0.2.14",
9696
"typescript": "^5.9.3",

packages/core/src/types/thirdParty.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -231,23 +231,24 @@ export interface StyleLoaderOptions {
231231
*/
232232
attributes?: Record<string, string>;
233233
/**
234-
* By default, the style-loader appends <style>/<link> elements to the end of the style target, which is the <head> tag of the page unless specified by insert.
234+
* By default, style-loader appends <style>/<link> elements to the end of the style target,
235+
* which is the <head> tag of the page unless specified by insert.
235236
* This will cause CSS created by the loader to take priority over CSS already present in the target.
236237
* You can use other values if the standard behavior is not suitable for you, but we do not recommend doing this.
238+
* If you target an iframe, make sure you have sufficient access rights.
239+
*
240+
* Supports:
241+
* - a CSS selector where styles are injected
242+
* - an absolute path to a custom insert module
237243
*
238244
* @default 'head'
239245
*/
240-
insert?:
241-
| LiteralUnion<'head' | 'body', string>
242-
| ((element: HTMLElement) => void);
246+
insert?: LiteralUnion<'head' | 'body', string>;
243247
/**
244-
* Allows to setup absolute path to custom function that allows to override default behavior styleTagTransform.
248+
* Allows to setup an absolute path to a custom module that overrides
249+
* the default styleTagTransform behavior.
250+
*
251+
* @default undefined
245252
*/
246-
styleTagTransform?:
247-
| string
248-
| ((
249-
css: string,
250-
styleElement: HTMLStyleElement,
251-
options: Record<string, any>,
252-
) => void);
253+
styleTagTransform?: string;
253254
}

pnpm-lock.yaml

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)