Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove css comments when css is bundled in js #93

Open
dmitrybelyakov opened this issue Jan 15, 2019 · 1 comment
Open

Remove css comments when css is bundled in js #93

dmitrybelyakov opened this issue Jan 15, 2019 · 1 comment

Comments

@dmitrybelyakov
Copy link

dmitrybelyakov commented Jan 15, 2019

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).

@sirockin
Copy link

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

sirockin pushed a commit to sirockin/json-editor that referenced this issue Aug 27, 2019
I've used the optivmize-css-assets-webpack-plugin as recommended. Comments still appear.
Somebody else reported the same issue in Jan but nobody has responded: :-O
NMFR/optimize-css-assets-webpack-plugin#93
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants