@@ -108,15 +108,15 @@ module.exports = function(webpackEnv) {
108
108
stage : 3 ,
109
109
} ) ,
110
110
] ,
111
- sourceMap : isEnvProduction && shouldUseSourceMap ,
111
+ sourceMap : isEnvProduction ? shouldUseSourceMap : isEnvDevelopment ,
112
112
} ,
113
113
} ,
114
114
] . filter ( Boolean ) ;
115
115
if ( preProcessor ) {
116
116
loaders . push ( {
117
117
loader : require . resolve ( preProcessor ) ,
118
118
options : {
119
- sourceMap : isEnvProduction && shouldUseSourceMap ,
119
+ sourceMap : isEnvProduction ? shouldUseSourceMap : isEnvDevelopment ,
120
120
} ,
121
121
} ) ;
122
122
}
@@ -441,7 +441,9 @@ module.exports = function(webpackEnv) {
441
441
exclude : cssModuleRegex ,
442
442
use : getStyleLoaders ( {
443
443
importLoaders : 1 ,
444
- sourceMap : isEnvProduction && shouldUseSourceMap ,
444
+ sourceMap : isEnvProduction
445
+ ? shouldUseSourceMap
446
+ : isEnvDevelopment ,
445
447
} ) ,
446
448
// Don't consider CSS imports dead code even if the
447
449
// containing package claims to have no side effects.
@@ -455,7 +457,9 @@ module.exports = function(webpackEnv) {
455
457
test : cssModuleRegex ,
456
458
use : getStyleLoaders ( {
457
459
importLoaders : 1 ,
458
- sourceMap : isEnvProduction && shouldUseSourceMap ,
460
+ sourceMap : isEnvProduction
461
+ ? shouldUseSourceMap
462
+ : isEnvDevelopment ,
459
463
modules : true ,
460
464
getLocalIdent : getCSSModuleLocalIdent ,
461
465
} ) ,
@@ -469,7 +473,9 @@ module.exports = function(webpackEnv) {
469
473
use : getStyleLoaders (
470
474
{
471
475
importLoaders : 2 ,
472
- sourceMap : isEnvProduction && shouldUseSourceMap ,
476
+ sourceMap : isEnvProduction
477
+ ? shouldUseSourceMap
478
+ : isEnvDevelopment ,
473
479
} ,
474
480
'sass-loader'
475
481
) ,
@@ -486,7 +492,9 @@ module.exports = function(webpackEnv) {
486
492
use : getStyleLoaders (
487
493
{
488
494
importLoaders : 2 ,
489
- sourceMap : isEnvProduction && shouldUseSourceMap ,
495
+ sourceMap : isEnvProduction
496
+ ? shouldUseSourceMap
497
+ : isEnvDevelopment ,
490
498
modules : true ,
491
499
getLocalIdent : getCSSModuleLocalIdent ,
492
500
} ,
0 commit comments