From b8c3e8427ba79b4a5d6bcb5fb5ff03e797e62ccc Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Mon, 1 Oct 2018 14:49:34 +0100 Subject: [PATCH] Treat .css and .sass/.scss as side effectful --- packages/react-scripts/config/webpack.config.prod.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index a6c6f736f0f..d71f2979caf 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -370,6 +370,11 @@ module.exports = { importLoaders: 1, sourceMap: shouldUseSourceMap, }), + // Don't consider CSS imports dead code even if the + // containing package claims to have no side effects. + // Remove this when webpack adds a warning or an error for this. + // See https://github.com/webpack/webpack/issues/6571 + sideEffects: true, }, // Adds support for CSS Modules (https://github.com/css-modules/css-modules) // using the extension .module.css @@ -397,6 +402,11 @@ module.exports = { }, 'sass-loader' ), + // Don't consider CSS imports dead code even if the + // containing package claims to have no side effects. + // Remove this when webpack adds a warning or an error for this. + // See https://github.com/webpack/webpack/issues/6571 + sideEffects: true, }, // Adds support for CSS Modules, but using SASS // using the extension .module.scss or .module.sass