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
Copy file name to clipboardExpand all lines: README.md
+23-6Lines changed: 23 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -122,7 +122,10 @@ module.exports = {
122
122
Type: `Boolean|Object`
123
123
Default: `true`
124
124
125
-
Enables/Disables handling the CSS functions `url` and `image-set`. If set to `false`, `css-loader` will not parse any paths specified in `url` or `image-set`. A function can also be passed to control this behavior dynamically based on the path to the asset. Starting with version [4.0.0](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md#400-2020-07-25), absolute paths are parsed based on the server root.
125
+
Allow to enable/disables handling the CSS functions `url` and `image-set`.
126
+
If set to `false`, `css-loader` will not parse any paths specified in `url` or `image-set`.
127
+
A function can also be passed to control this behavior dynamically based on the path to the asset.
128
+
Starting with version [4.0.0](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md#400-2020-07-25), absolute paths are parsed based on the server root.
126
129
127
130
Examples resolutions:
128
131
@@ -203,7 +206,7 @@ module.exports = {
203
206
Type: `Boolean|Object`
204
207
Default: `true`
205
208
206
-
Enables/Disables`@import` at-rules handling.
209
+
Allows to enables/disables`@import` at-rules handling.
207
210
Control `@import` resolving. Absolute urls in `@import` will be moved in runtime code.
208
211
209
212
Examples resolutions:
@@ -335,9 +338,15 @@ This may change in the future when the module system (i. e. webpack) supports lo
335
338
### `modules`
336
339
337
340
Type: `Boolean|String|Object`
338
-
Default: based on filename, `true` for all files matching `/\.module\.\w+$/i.test(filename)` regular expression, more information you can read [here](https://github.com/webpack-contrib/css-loader#auto)
341
+
Default: `undefined`
342
+
343
+
Allows to enable/disable CSS Modules or ICSS and setup configuration:
339
344
340
-
Enables/Disables CSS Modules and their configuration.
345
+
-`undefined` - enable CSS modules for all files matching `/\.module\.\w+$/i.test(filename)` and `/\.icss\.\w+$/i.test(filename)` regexp.
346
+
-`true` - enable CSS modules for all files.
347
+
-`false` - disables CSS Modules for all files.
348
+
-`string` - disables CSS Modules for all files and set the `mode` option, more information you can read [here](https://github.com/webpack-contrib/css-loader#mode)
349
+
-`object` - enable CSS modules for all files, if `modules.auto` option is not specified, otherwise the `modules.auto` option will determine whether if it is CSS modules or not, more information you can read [here](https://github.com/webpack-contrib/css-loader#auto)
341
350
342
351
The `modules` option enables/disables the **[CSS Modules](https://github.com/css-modules/css-modules)** specification and setup basic behaviour.
343
352
@@ -598,9 +607,17 @@ module.exports = {
598
607
##### `auto`
599
608
600
609
Type: `Boolean|RegExp|Function`
601
-
Default: `'true'`
610
+
Default: `undefined`
611
+
612
+
Allows auto enable CSS modules/ICSS based on filename when `modules` option is object.
613
+
614
+
Possible values:
602
615
603
-
Allows auto enable CSS modules based on filename.
616
+
-`undefined` - enable CSS modules for all files.
617
+
-`true` - enable CSS modules for all files matching `/\.module\.\w+$/i.test(filename)` and `/\.icss\.\w+$/i.test(filename)` regexp.
618
+
-`false` - disables CSS Modules.
619
+
-`RegExp` - enable CSS modules for all files matching `/RegExp/i.test(filename)` regexp.
620
+
-`function` - enable CSS Modules for files based on the filename satisfying your filter function check.
0 commit comments