You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|**[`url`](#url)**|`{Boolean\|Object}`|`true`| Allows to enables/disables `url()`/`image-set()` functions handling |
93
-
|**[`import`](#import)**|`{Boolean\|Object}`|`true`| Allows to enables/disables `@import` at-rules handling |
94
-
|**[`modules`](#modules)**|`{Boolean\|String\|Object}`|`{auto: true}`| Allows to enables/disables or setup CSS Modules options |
95
-
|**[`sourceMap`](#sourcemap)**|`{Boolean}`|`compiler.devtool`| Enables/Disables generation of source maps |
96
-
|**[`importLoaders`](#importloaders)**|`{Number}`|`0`| Allows enables/disables or setups number of loaders applied before CSS loader for `@import`/CSS Modules and ICSS imports |
97
-
|**[`esModule`](#esmodule)**|`{Boolean}`|`true`| Use ES modules syntax |
|**[`url`](#url)**|`{Boolean\|Object}`|`true`| Allows to enables/disables `url()`/`image-set()` functions handling |
93
+
|**[`import`](#import)**|`{Boolean\|Object}`|`true`| Allows to enables/disables `@import` at-rules handling |
94
+
|**[`modules`](#modules)**|`{Boolean\|String\|Object}`|`{auto: true}`| Allows to enables/disables or setup CSS Modules options |
95
+
|**[`sourceMap`](#sourcemap)**|`{Boolean}`|`compiler.devtool`| Enables/Disables generation of source maps |
96
+
|**[`importLoaders`](#importloaders)**|`{Number}`|`0`| Allows enables/disables or setups number of loaders applied before CSS loader for `@import`/CSS Modules and ICSS imports |
97
+
|**[`esModule`](#esmodule)**|`{Boolean}`|`true`| Use ES modules syntax |
98
+
|**[`exportType`](#exporttype)**|`{'array' \| 'css-style-sheet'}`|`array`| Allows exporting styles as array with modules or [constructable stylesheet](https://developers.google.com/web/updates/2019/02/constructable-stylesheets) (i.e. [`CSSStyleSheet`](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet)) |
98
99
99
100
### `url`
100
101
@@ -1269,6 +1270,173 @@ module.exports = {
1269
1270
};
1270
1271
```
1271
1272
1273
+
### `exportType`
1274
+
1275
+
Type: `'array' | 'css-style-sheet'`
1276
+
Default: `'array'`
1277
+
1278
+
Allows exporting styles as array with modules or [constructable stylesheet](https://developers.google.com/web/updates/2019/02/constructable-stylesheets) (i.e. [`CSSStyleSheet`](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet)).
1279
+
Default value is `'array'`, i.e. loader exports array of modules with specific API which is used in `style-loader` or other.
> ⚠ `@import` rules not yet allowed, more [information](https://web.dev/css-module-scripts/#@import-rules-not-yet-allowed)
1337
+
> ⚠ You don't need [`style-loader`](https://github.com/webpack-contrib/style-loader) anymore, please remove it.
1338
+
> ⚠ The `esModules` option should be enabled if you want to use it with [`CSS modules`](https://github.com/webpack-contrib/css-loader#modules), by default for locals will be used [named export](https://github.com/webpack-contrib/css-loader#namedexport).
1339
+
> ⚠ Source maps are not currently supported in `Chrome` due [bug](https://bugs.chromium.org/p/chromium/issues/detail?id=1174094&q=CSSStyleSheet%20source%20maps&can=2)
1340
+
1341
+
The default export is a [constructable stylesheet](https://developers.google.com/web/updates/2019/02/constructable-stylesheets) (i.e. [`CSSStyleSheet`](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet)).
1342
+
1343
+
Useful for [custom elements](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) and shadow DOM.
1344
+
1345
+
More information:
1346
+
1347
+
-[Using CSS Module Scripts to import stylesheets](https://web.dev/css-module-scripts/)
0 commit comments