From b596cd76079fe0f57b1802046647b25ce6223326 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 8 Jun 2021 15:11:20 -0700 Subject: [PATCH] webpack: Fix CSS source map generation on 1-CPU systems. We were passing a SourceMapGenerator as `map`, but it seems that css-minimizer-webpack-plugin expects a string, and only implicitly stringifies it when running with parallelism. Fixes #18727. Signed-off-by: Anders Kaseorg (cherry picked from commit aedc5af35109a9ec1407d3caed324f13108ca754) --- webpack.config.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webpack.config.ts b/webpack.config.ts index f16317dc24..7bc59890f3 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -189,7 +189,11 @@ export default (_env: unknown, argv: {mode?: string}): webpack.Configuration[] = const out = new CleanCSS({sourceMap: true}).minify({ [filename]: {styles, sourceMap}, }); - return {css: out.styles, map: out.sourceMap, warnings: out.warnings}; + return { + css: out.styles, + map: out.sourceMap.toString(), + warnings: out.warnings, + }; }, }), new TerserPlugin({