From 891eb94774d058d2754066fab6952fbcaed23fee Mon Sep 17 00:00:00 2001 From: Josh Hunt Date: Fri, 8 Nov 2019 14:51:11 +0000 Subject: [PATCH] Increment importLoaders for rulesets where there's a preprocessor (fixes #7919) --- packages/react-scripts/config/webpack.config.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index d34d06f1148..74a0a1492d9 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -141,6 +141,8 @@ module.exports = function(webpackEnv) { sourceMap: true, }, } + // ** STOP ** Are you adding a new loader after css-loader? + // Make sure to increment importLoaders appropriately where getStyleLoaders is called. ); } return loaders; @@ -528,7 +530,7 @@ module.exports = function(webpackEnv) { exclude: sassModuleRegex, use: getStyleLoaders( { - importLoaders: 2, + importLoaders: 3, sourceMap: isEnvProduction && shouldUseSourceMap, }, 'sass-loader' @@ -545,7 +547,7 @@ module.exports = function(webpackEnv) { test: sassModuleRegex, use: getStyleLoaders( { - importLoaders: 2, + importLoaders: 3, sourceMap: isEnvProduction && shouldUseSourceMap, modules: { getLocalIdent: getCSSModuleLocalIdent,