Skip to content

Commit 915293e

Browse files
authored
feat(css): add exportType style to inject styles into DOM (#20579)
1 parent d6927b4 commit 915293e

31 files changed

Lines changed: 695 additions & 165 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"webpack": minor
3+
---
4+
5+
Add `exportType: "style"` for CSS modules to inject styles into DOM via HTMLStyleElement, similar to style-loader functionality.

declarations/WebpackOptions.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ export type CssGeneratorLocalIdentName = string;
789789
/**
790790
* Configure how CSS content is exported as default.
791791
*/
792-
export type CssParserExportType = "link" | "text" | "css-style-sheet";
792+
export type CssParserExportType = "link" | "text" | "css-style-sheet" | "style";
793793
/**
794794
* Enable/disable renaming of `@keyframes`.
795795
*/

lib/RuntimeGlobals.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ module.exports.createScriptUrl = "__webpack_require__.tu";
8282
* merge multiple CSS stylesheets (CSSStyleSheet or string) into one CSS text string
8383
* Arguments: (sheets: Array<CSSStyleSheet | string> | CSSStyleSheet | string) => string
8484
*/
85+
module.exports.cssInjectStyle = "__webpack_require__.is";
8586
module.exports.cssMergeStyleSheets = "__webpack_require__.mcs";
8687

8788
/**

0 commit comments

Comments
 (0)