From 4a96247bf014905faedffa2baf206d19b246601f Mon Sep 17 00:00:00 2001 From: Dan Abramov <dan.abramov@gmail.com> Date: Mon, 1 Oct 2018 15:07:09 +0100 Subject: [PATCH] Treat .css and .sass/.scss as side effectful (#5197) --- 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 a6c6f736f..d71f2979c 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 -- GitLab