Skip to content

Commit 59b51e0

Browse files
authored
Output CSS sourcemaps in separate file (facebook#5131)
* Output CSS sourcemaps in separate file * explain options
1 parent a8fdecd commit 59b51e0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

config/webpack.config.prod.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,17 @@ module.exports = {
158158
sourceMap: shouldUseSourceMap,
159159
}),
160160
new OptimizeCSSAssetsPlugin({
161-
cssProcessorOptions: { parser: safePostCssParser },
161+
cssProcessorOptions: {
162+
parser: safePostCssParser,
163+
map: {
164+
// `inline: false` forces the sourcemap to be output into a
165+
// separate file
166+
inline: false,
167+
// `annotation: true` appends the sourceMappingURL to the end of
168+
// the css file, helping the browser find the sourcemap
169+
annotation: true,
170+
},
171+
},
162172
}),
163173
],
164174
// Automatically split vendor and commons

0 commit comments

Comments
 (0)