Skip to content

Commit

Permalink
revert css sourcemaps in development (#6472)
Browse files Browse the repository at this point in the history
This fixes #6399.
  • Loading branch information
Jack Zhao authored and Timer committed Feb 20, 2019
1 parent d57fd37 commit 28f5427
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions packages/react-scripts/config/webpack.config.js
Expand Up @@ -108,15 +108,15 @@ module.exports = function(webpackEnv) {
stage: 3,
}),
],
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
sourceMap: isEnvProduction && shouldUseSourceMap,
},
},
].filter(Boolean);
if (preProcessor) {
loaders.push({
loader: require.resolve(preProcessor),
options: {
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
sourceMap: isEnvProduction && shouldUseSourceMap,
},
});
}
Expand Down Expand Up @@ -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.
Expand All @@ -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,
}),
Expand All @@ -473,9 +469,7 @@ module.exports = function(webpackEnv) {
use: getStyleLoaders(
{
importLoaders: 2,
sourceMap: isEnvProduction
? shouldUseSourceMap
: isEnvDevelopment,
sourceMap: isEnvProduction && shouldUseSourceMap,
},
'sass-loader'
),
Expand All @@ -492,9 +486,7 @@ module.exports = function(webpackEnv) {
use: getStyleLoaders(
{
importLoaders: 2,
sourceMap: isEnvProduction
? shouldUseSourceMap
: isEnvDevelopment,
sourceMap: isEnvProduction && shouldUseSourceMap,
modules: true,
getLocalIdent: getCSSModuleLocalIdent,
},
Expand Down

0 comments on commit 28f5427

Please sign in to comment.