From df03772d108491adacb6664e1119dd245856b1af Mon Sep 17 00:00:00 2001 From: Jack Zhao Date: Wed, 20 Feb 2019 11:47:06 -0800 Subject: [PATCH] revert sass sourcemaps in development --- .../react-scripts/config/webpack.config.js | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 7aaee11ccf0..a3e31b14824 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -108,7 +108,7 @@ module.exports = function(webpackEnv) { stage: 3, }), ], - sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment, + sourceMap: isEnvProduction && shouldUseSourceMap, }, }, ].filter(Boolean); @@ -116,7 +116,7 @@ module.exports = function(webpackEnv) { loaders.push({ loader: require.resolve(preProcessor), options: { - sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment, + sourceMap: isEnvProduction && shouldUseSourceMap, }, }); } @@ -441,9 +441,7 @@ module.exports = function(webpackEnv) { exclude: cssModuleRegex, use: getStyleLoaders({ importLoaders: 1, - sourceMap: isEnvProduction - ? shouldUseSourceMap - : isEnvDevelopment, + sourceMap: isEnvProduction && shouldUseSourceMap, }), // Don't consider CSS imports dead code even if the // containing package claims to have no side effects. @@ -457,9 +455,7 @@ module.exports = function(webpackEnv) { test: cssModuleRegex, use: getStyleLoaders({ importLoaders: 1, - sourceMap: isEnvProduction - ? shouldUseSourceMap - : isEnvDevelopment, + sourceMap: isEnvProduction && shouldUseSourceMap, modules: true, getLocalIdent: getCSSModuleLocalIdent, }), @@ -473,9 +469,7 @@ module.exports = function(webpackEnv) { use: getStyleLoaders( { importLoaders: 2, - sourceMap: isEnvProduction - ? shouldUseSourceMap - : isEnvDevelopment, + sourceMap: isEnvProduction && shouldUseSourceMap, }, 'sass-loader' ), @@ -492,9 +486,7 @@ module.exports = function(webpackEnv) { use: getStyleLoaders( { importLoaders: 2, - sourceMap: isEnvProduction - ? shouldUseSourceMap - : isEnvDevelopment, + sourceMap: isEnvProduction && shouldUseSourceMap, modules: true, getLocalIdent: getCSSModuleLocalIdent, },