revert css sourcemaps in development (#6472)

This fixes #6399.
This commit is contained in:
Jack Zhao
2019-02-20 13:16:18 -08:00
committed by Joe Haddad
parent d57fd37d2d
commit 28f5427979

View File

@@ -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,
},