From 59b51e0b0d3378b1c09567b616e8b64e8bcc24ea Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Thu, 27 Sep 2018 09:13:27 -0400 Subject: [PATCH] Output CSS sourcemaps in separate file (#5131) * Output CSS sourcemaps in separate file * explain options --- config/webpack.config.prod.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 87b61980eac..8fe4f6189c6 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -158,7 +158,17 @@ module.exports = { sourceMap: shouldUseSourceMap, }), new OptimizeCSSAssetsPlugin({ - cssProcessorOptions: { parser: safePostCssParser }, + cssProcessorOptions: { + parser: safePostCssParser, + map: { + // `inline: false` forces the sourcemap to be output into a + // separate file + inline: false, + // `annotation: true` appends the sourceMappingURL to the end of + // the css file, helping the browser find the sourcemap + annotation: true, + }, + }, }), ], // Automatically split vendor and commons