Skip to content

Commit 4a96247

Browse files
authored
Treat .css and .sass/.scss as side effectful (#5197)
1 parent 53e4c0a commit 4a96247

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/react-scripts/config/webpack.config.prod.js

+10
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,11 @@ module.exports = {
370370
importLoaders: 1,
371371
sourceMap: shouldUseSourceMap,
372372
}),
373+
// Don't consider CSS imports dead code even if the
374+
// containing package claims to have no side effects.
375+
// Remove this when webpack adds a warning or an error for this.
376+
// See https://github.com/webpack/webpack/issues/6571
377+
sideEffects: true,
373378
},
374379
// Adds support for CSS Modules (https://github.com/css-modules/css-modules)
375380
// using the extension .module.css
@@ -397,6 +402,11 @@ module.exports = {
397402
},
398403
'sass-loader'
399404
),
405+
// Don't consider CSS imports dead code even if the
406+
// containing package claims to have no side effects.
407+
// Remove this when webpack adds a warning or an error for this.
408+
// See https://github.com/webpack/webpack/issues/6571
409+
sideEffects: true,
400410
},
401411
// Adds support for CSS Modules, but using SASS
402412
// using the extension .module.scss or .module.sass

0 commit comments

Comments
 (0)