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

Remove css comments when css is bundled in js

Open dmitrybelyakov opened this issue 6 years ago • 1 comments

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 avatar Jan 15 '19 18:01 dmitrybelyakov

@dmitrybelyakov did you find a solution to this? I have the same issue and surprised nobody has responed here.

sirockin avatar Aug 22 '19 13:08 sirockin