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
|**[`modules`](#modules)**|`{Boolean\|String\|Object}`|`{auto: true}`| Enables/Disables CSS Modules and their configuration |
117
+
|**[`sourceMap`](#sourcemap)**|`{Boolean}`|`compiler.devtool`| Enables/Disables generation of source maps |
118
+
|**[`importLoaders`](#importloaders)**|`{Number}`|`0`| Enables/Disables or setups number of loaders applied before CSS loader |
119
+
|**[`esModule`](#esmodule)**|`{Boolean}`|`true`| Use ES modules syntax |
121
120
122
121
### `url`
123
122
@@ -526,6 +525,7 @@ module.exports = {
526
525
loader:'css-loader',
527
526
options: {
528
527
modules: {
528
+
compileType:'module',
529
529
mode:'local',
530
530
auto:true,
531
531
exportGlobals:true,
@@ -543,6 +543,38 @@ module.exports = {
543
543
};
544
544
```
545
545
546
+
##### `compileType`
547
+
548
+
Type: `'module' | 'icss'`
549
+
Default: `'module'`
550
+
551
+
Controls the level of compilation applied to the input styles.
552
+
553
+
The `module` handles `class` and `id` scoping and `@value` values.
554
+
The `icss` will only compile the low level `Interoperable CSS` format for declaring `:import` and `:export` dependencies between CSS and other languages.
555
+
556
+
ICSS underpins CSS Module support, and provides a low level syntax for other tools to implement CSS-module variations of their own.
557
+
558
+
**webpack.config.js**
559
+
560
+
```js
561
+
module.exports= {
562
+
module: {
563
+
rules: [
564
+
{
565
+
test:/\.css$/i,
566
+
loader:'css-loader',
567
+
options: {
568
+
modules: {
569
+
compileType:'icss',
570
+
},
571
+
},
572
+
},
573
+
],
574
+
},
575
+
};
576
+
```
577
+
546
578
##### `auto`
547
579
548
580
Type: `Boolean|RegExp|Function`
@@ -1001,33 +1033,6 @@ module.exports = {
1001
1033
};
1002
1034
```
1003
1035
1004
-
### `icss`
1005
-
1006
-
Type: Boolean Default: `true` if `modules` are enabled, false otherwise
1007
-
1008
-
Enables/disables handling of the low level "Interoperable CSS" format for declaring
1009
-
import and export dependencies between CSS and other languages. ICSS enables
1010
-
CSS Module support, and is enabled automatically when `modules` are enabled. It
1011
-
can also be enabled independently to allow other loaders to handle processing CSS modules.
0 commit comments