diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index 87b61980eac..8fe4f6189c6 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/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