optimize-css-assets-webpack-plugin icon indicating copy to clipboard operation
optimize-css-assets-webpack-plugin copied to clipboard

It's totally not obvious how to make source maps work

Open x-yuri opened this issue 5 years ago • 2 comments

Wrong:

new OptimizeCssAssetsPlugin({cssProcessorOptions: {map: true}})

Correct:

new OptimizeCssAssetsPlugin({cssProcessorOptions: {map: {inline: false, annotations: true}}})

Since with optimize-css-assets-webpack-plugin map is supposed to be an object. More info here.

At least this much is worth mentioning in the README,

x-yuri avatar Sep 17 '18 14:09 x-yuri

Thanks for sharing this! I was struggling on the same problem since a couple of hours. Nevertheless, there is a typo in the annotations parameter provided to PostCSS (see https://github.com/postcss/postcss/blob/master/docs/source-maps.md) The correct solution is:

new OptimizeCssAssetsPlugin({cssProcessorOptions: {map: {inline: false, annotation: true}}})

anlambert avatar Mar 05 '19 15:03 anlambert

Everything now works correctly! Thank you

iambalaam avatar Mar 06 '19 12:03 iambalaam