@@ -5,7 +5,6 @@ const resolve = require('resolve');
5
5
const webpack = require ( 'webpack' ) ;
6
6
const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' ) ;
7
7
const ESLintPlugin = require ( 'eslint-webpack-plugin' ) ;
8
- const getCSSModuleLocalIdent = require ( 'react-dev-utils/getCSSModuleLocalIdent' ) ;
9
8
const ModuleNotFoundPlugin = require ( 'react-dev-utils/ModuleNotFoundPlugin' ) ;
10
9
const ForkTsCheckerWebpackPlugin =
11
10
process . env . TSC_COMPILE_ON_ERROR === 'true'
@@ -30,7 +29,7 @@ const hasJsxRuntime = (() => {
30
29
31
30
module . exports = function ( isEnvProduction ) {
32
31
const isEnvDevelopment = ! isEnvProduction ;
33
- const getStyleLoaders = ( cssOptions , preProcessor ) => {
32
+ const getStyleLoaders = ( cssOptions , preProcessor , preProcessorOptions ) => {
34
33
const loaders = [
35
34
isEnvDevelopment && require . resolve ( 'style-loader' ) ,
36
35
isEnvProduction && {
@@ -81,7 +80,8 @@ module.exports = function(isEnvProduction) {
81
80
{
82
81
loader : require . resolve ( preProcessor ) ,
83
82
options : {
84
- sourceMap : true
83
+ sourceMap : true ,
84
+ ...preProcessorOptions
85
85
}
86
86
}
87
87
) ;
@@ -178,7 +178,10 @@ module.exports = function(isEnvProduction) {
178
178
exclude : / \. m o d u l e \. c s s $ / ,
179
179
use : getStyleLoaders ( {
180
180
importLoaders : 1 ,
181
- sourceMap : true
181
+ sourceMap : true ,
182
+ modules : {
183
+ mode : 'icss' ,
184
+ }
182
185
} ) ,
183
186
sideEffects : true
184
187
} ,
@@ -188,9 +191,17 @@ module.exports = function(isEnvProduction) {
188
191
use : getStyleLoaders (
189
192
{
190
193
importLoaders : 3 ,
191
- sourceMap : true
194
+ sourceMap : true ,
195
+ modules : {
196
+ mode : 'icss' ,
197
+ }
192
198
} ,
193
- 'sass-loader'
199
+ 'sass-loader' ,
200
+ {
201
+ sassOptions : {
202
+ outputStyle : 'expanded'
203
+ }
204
+ }
194
205
) ,
195
206
sideEffects : true
196
207
} ,
0 commit comments