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
+18-4
Original file line number
Diff line number
Diff line change
@@ -335,9 +335,15 @@ This may change in the future when the module system (i. e. webpack) supports lo
335
335
### `modules`
336
336
337
337
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)
338
+
Default: `undefined`
339
+
340
+
Enables/Disables CSS Modules and their configuration:
339
341
340
-
Enables/Disables CSS Modules and their configuration.
342
+
-`undefined` - processed all files matching `/\.module\.\w+$/i.test(filename)` and `/\.icss\.\w+$/i.test(filename)` regular expression
343
+
-`true` - processed all files
344
+
-`false` - disables CSS Modules
345
+
-`string` - processed all files, more information you can read [here](https://github.com/webpack-contrib/css-loader#mode)
346
+
-`object` - processed all files, when `modules.auto` option is not specified, more information you can read [here](https://github.com/webpack-contrib/css-loader#auto)
341
347
342
348
The `modules` option enables/disables the **[CSS Modules](https://github.com/css-modules/css-modules)** specification and setup basic behaviour.
343
349
@@ -598,9 +604,17 @@ module.exports = {
598
604
##### `auto`
599
605
600
606
Type: `Boolean|RegExp|Function`
601
-
Default: `'true'`
607
+
Default: `undefined`
608
+
609
+
Allows auto enable CSS modules based on filename when `modules` option is object.
610
+
611
+
Possible values:
602
612
603
-
Allows auto enable CSS modules based on filename.
613
+
-`undefined` - processed all files
614
+
-`true` - processed all files matching `/\.module\.\w+$/i.test(filename)` and `/\.icss\.\w+$/i.test(filename)` regular expression
615
+
-`false` - disables CSS Modules
616
+
-`RegExp` - processed all files matching `/RegExp/i.test(filename)` regular expression
617
+
-`Function` - enable CSS Modules for files based on the filename satisfying your filter function check.
0 commit comments