optimize-css-assets-webpack-plugin
optimize-css-assets-webpack-plugin copied to clipboard
Remove css comments when css is bundled in js
I'm on webpack 4 and have tried both options below:
optimization: {
minimizer: [
new UglifyJsPlugin({uglifyOptions: cfg.js.uglify}),
new OptimizeCSSAssetsPlugin({}),
]
and this as well:
optimization: {
minimizer: [
new UglifyJsPlugin({uglifyOptions: cfg.js.uglify}),
new OptimizeCSSAssetsPlugin({
cssProcessor: require('cssnano'),
cssProcessorPluginOptions: {
preset: ['default', { discardComments: { removeAll: true } }],
}
}),
]
}
In both cases sass/css comments are present in the js bundles (we do not extract css).
@dmitrybelyakov did you find a solution to this? I have the same issue and surprised nobody has responed here.