File tree Expand file tree Collapse file tree 3 files changed +54
-5
lines changed
packages/react-scripts/config Expand file tree Collapse file tree 3 files changed +54
-5
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -181,11 +181,13 @@ module.exports = {
181
181
// "file" loader makes sure those assets get served by WebpackDevServer.
182
182
// When you `import` an asset, you get its (virtual) filename.
183
183
// In production, they would get copied to the `build` folder.
184
+ // ZEAL: Add .scss because we add the sass-loader below.
184
185
{
185
186
exclude : [
186
187
/ \. h t m l $ / ,
187
188
/ \. ( j s | j s x ) $ / ,
188
189
/ \. c s s $ / ,
190
+ / \. s c s s $ / ,
189
191
/ \. j s o n $ / ,
190
192
/ \. b m p $ / ,
191
193
/ \. g i f $ / ,
@@ -271,6 +273,26 @@ module.exports = {
271
273
} ,
272
274
] ,
273
275
} ,
276
+ // ZEAL: Adds support for Sass with CSS Modules
277
+ {
278
+ test : / \. s c s s $ / ,
279
+ use : [
280
+ require . resolve ( 'style-loader' ) ,
281
+ {
282
+ loader : require . resolve ( 'css-loader' ) ,
283
+ options : {
284
+ importLoaders : 1 ,
285
+ modules : true ,
286
+ localIdentName : '[name]__[local]___[hash:base64:5]' ,
287
+ } ,
288
+ } ,
289
+ {
290
+ loader : require . resolve ( 'postcss-loader' ) ,
291
+ options : postCSSLoaderOptions ,
292
+ } ,
293
+ require . resolve ( 'sass-loader' ) ,
294
+ ] ,
295
+ } ,
274
296
// ** STOP ** Are you adding a new loader?
275
297
// Remember to add the new extension(s) to the "file" loader exclusion list.
276
298
] ,
Original file line number Diff line number Diff line change @@ -174,11 +174,13 @@ module.exports = {
174
174
175
175
// "file" loader makes sure those assets end up in the `build` folder.
176
176
// When you `import` an asset, you get its filename.
177
+ // ZEAL: Add .scss because we add the sass-loader below.
177
178
{
178
179
exclude : [
179
180
/ \. h t m l $ / ,
180
181
/ \. ( j s | j s x ) $ / ,
181
182
/ \. c s s $ / ,
183
+ / \. s c s s $ / ,
182
184
/ \. j s o n $ / ,
183
185
/ \. b m p $ / ,
184
186
/ \. g i f $ / ,
@@ -286,6 +288,36 @@ module.exports = {
286
288
) ,
287
289
// Note: this won't work without `new ExtractTextPlugin()` in `plugins`.
288
290
} ,
291
+ // ZEAL: Adds support for Sass with CSS Modules
292
+ {
293
+ test : / .s c s s $ / ,
294
+ loader : ExtractTextPlugin . extract (
295
+ Object . assign (
296
+ {
297
+ fallback : require . resolve ( 'style-loader' ) ,
298
+ use : [
299
+ {
300
+ loader : require . resolve ( 'css-loader' ) ,
301
+ options : {
302
+ importLoaders : 1 ,
303
+ minimize : true ,
304
+ sourceMap : true ,
305
+ modules : true ,
306
+ localIdentName : '[name]__[local]___[hash:base64:5]' ,
307
+ } ,
308
+ } ,
309
+ {
310
+ loader : require . resolve ( 'postcss-loader' ) ,
311
+ options : postCSSLoaderOptions ,
312
+ } ,
313
+ require . resolve ( 'sass-loader' ) ,
314
+ ] ,
315
+ } ,
316
+ extractTextPluginOptions
317
+ )
318
+ ) ,
319
+ // Note: this won't work without `new ExtractTextPlugin()` in `plugins`.
320
+ } ,
289
321
// ** STOP ** Are you adding a new loader?
290
322
// Remember to add the new extension(s) to the "file" loader exclusion list.
291
323
] ,
You can’t perform that action at this time.
0 commit comments