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 <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-06-08 15:11:20 -07:00 committed by Anders Kaseorg
parent 721546dfc0
commit aedc5af351
1 changed files with 5 additions and 1 deletions

View File

@ -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({