Skip to content
This repository has been archived by the owner on Jul 24, 2019. It is now read-only.

Commit

Permalink
Sass source map for dev (facebook#5713)
Browse files Browse the repository at this point in the history
Sass source map for dev
  • Loading branch information
alicialics authored and Jack Zhao committed Feb 8, 2019
1 parent 30c9d9e commit 3b5ebcb
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ module.exports = function(webpackEnv) {
stage: 3,
}),
],
sourceMap: isEnvProduction && shouldUseSourceMap,
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
},
},
].filter(Boolean);
if (preProcessor) {
loaders.push({
loader: require.resolve(preProcessor),
options: {
sourceMap: isEnvProduction && shouldUseSourceMap,
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
},
});
}
Expand Down Expand Up @@ -441,7 +441,9 @@ module.exports = function(webpackEnv) {
exclude: cssModuleRegex,
use: getStyleLoaders({
importLoaders: 1,
sourceMap: isEnvProduction && shouldUseSourceMap,
sourceMap: isEnvProduction
? shouldUseSourceMap
: isEnvDevelopment,
}),
// Don't consider CSS imports dead code even if the
// containing package claims to have no side effects.
Expand All @@ -455,7 +457,9 @@ module.exports = function(webpackEnv) {
test: cssModuleRegex,
use: getStyleLoaders({
importLoaders: 1,
sourceMap: isEnvProduction && shouldUseSourceMap,
sourceMap: isEnvProduction
? shouldUseSourceMap
: isEnvDevelopment,
modules: true,
getLocalIdent: getCSSModuleLocalIdent,
}),
Expand All @@ -469,7 +473,9 @@ module.exports = function(webpackEnv) {
use: getStyleLoaders(
{
importLoaders: 2,
sourceMap: isEnvProduction && shouldUseSourceMap,
sourceMap: isEnvProduction
? shouldUseSourceMap
: isEnvDevelopment,
},
'sass-loader'
),
Expand All @@ -486,7 +492,9 @@ module.exports = function(webpackEnv) {
use: getStyleLoaders(
{
importLoaders: 2,
sourceMap: isEnvProduction && shouldUseSourceMap,
sourceMap: isEnvProduction
? shouldUseSourceMap
: isEnvDevelopment,
modules: true,
getLocalIdent: getCSSModuleLocalIdent,
},
Expand Down

0 comments on commit 3b5ebcb

Please sign in to comment.