From 9ec5fb40114b90201cb895abd07e6ac902f96342 Mon Sep 17 00:00:00 2001 From: thabemmz Date: Fri, 5 Feb 2021 13:58:41 +0100 Subject: [PATCH] Add explicit compileType for CSSLoader configuration in webpack.config --- packages/react-scripts/config/webpack.config.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index ba8fd0b9b56..ca673890d63 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -516,6 +516,9 @@ module.exports = function (webpackEnv) { sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment, + modules: { + compileType: 'icss', + }, }), // Don't consider CSS imports dead code even if the // containing package claims to have no side effects. @@ -533,6 +536,7 @@ module.exports = function (webpackEnv) { ? shouldUseSourceMap : isEnvDevelopment, modules: { + compileType: 'module', getLocalIdent: getCSSModuleLocalIdent, }, }), @@ -549,6 +553,9 @@ module.exports = function (webpackEnv) { sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment, + modules: { + compileType: 'icss', + }, }, 'sass-loader' ), @@ -569,6 +576,7 @@ module.exports = function (webpackEnv) { ? shouldUseSourceMap : isEnvDevelopment, modules: { + compileType: 'module', getLocalIdent: getCSSModuleLocalIdent, }, },