Skip to content

Commit b37cff9

Browse files
authored
Support source maps for scss in dev environments (#8638)
1 parent 2975939 commit b37cff9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: packages/react-scripts/config/webpack.config.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ module.exports = function(webpackEnv) {
123123
// which in turn let's users customize the target behavior as per their needs.
124124
postcssNormalize(),
125125
],
126-
sourceMap: isEnvProduction && shouldUseSourceMap,
126+
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
127127
},
128128
},
129129
].filter(Boolean);
@@ -132,7 +132,7 @@ module.exports = function(webpackEnv) {
132132
{
133133
loader: require.resolve('resolve-url-loader'),
134134
options: {
135-
sourceMap: isEnvProduction && shouldUseSourceMap,
135+
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
136136
},
137137
},
138138
{
@@ -498,7 +498,7 @@ module.exports = function(webpackEnv) {
498498
exclude: cssModuleRegex,
499499
use: getStyleLoaders({
500500
importLoaders: 1,
501-
sourceMap: isEnvProduction && shouldUseSourceMap,
501+
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
502502
}),
503503
// Don't consider CSS imports dead code even if the
504504
// containing package claims to have no side effects.
@@ -512,7 +512,7 @@ module.exports = function(webpackEnv) {
512512
test: cssModuleRegex,
513513
use: getStyleLoaders({
514514
importLoaders: 1,
515-
sourceMap: isEnvProduction && shouldUseSourceMap,
515+
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
516516
modules: {
517517
getLocalIdent: getCSSModuleLocalIdent,
518518
},
@@ -527,7 +527,7 @@ module.exports = function(webpackEnv) {
527527
use: getStyleLoaders(
528528
{
529529
importLoaders: 3,
530-
sourceMap: isEnvProduction && shouldUseSourceMap,
530+
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
531531
},
532532
'sass-loader'
533533
),
@@ -544,7 +544,7 @@ module.exports = function(webpackEnv) {
544544
use: getStyleLoaders(
545545
{
546546
importLoaders: 3,
547-
sourceMap: isEnvProduction && shouldUseSourceMap,
547+
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
548548
modules: {
549549
getLocalIdent: getCSSModuleLocalIdent,
550550
},

0 commit comments

Comments
 (0)