Skip to content

Commit d624f25

Browse files
crux153Timer
authored andcommittedOct 2, 2018
Fix GENERATE_SOURCEMAP env not working for css (#5246)
1 parent d58253d commit d624f25

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed
 

‎packages/react-scripts/config/webpack.config.prod.js

+10-8
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,16 @@ module.exports = {
171171
new OptimizeCSSAssetsPlugin({
172172
cssProcessorOptions: {
173173
parser: safePostCssParser,
174-
map: {
175-
// `inline: false` forces the sourcemap to be output into a
176-
// separate file
177-
inline: false,
178-
// `annotation: true` appends the sourceMappingURL to the end of
179-
// the css file, helping the browser find the sourcemap
180-
annotation: true,
181-
},
174+
map: shouldUseSourceMap
175+
? {
176+
// `inline: false` forces the sourcemap to be output into a
177+
// separate file
178+
inline: false,
179+
// `annotation: true` appends the sourceMappingURL to the end of
180+
// the css file, helping the browser find the sourcemap
181+
annotation: true,
182+
}
183+
: false,
182184
},
183185
}),
184186
],

0 commit comments

Comments
 (0)
Please sign in to comment.