Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove all comments with CSS Loader with webpack 2 in string mode?

I use this config for my webpack 2

        {
            test: /\.css$/i,
            use: ExtractTextPlugin.extract({
                use: 'css-loader?minimize'
            })
        }

How to remove all comments based on string mode ? I use this but does not work

  'css-loader?minimize&{discardComments:{removeAll:true}}'

Can anyone help me ?

like image 935
HamedFathi Avatar asked Apr 12 '17 04:04

HamedFathi


1 Answers

You could use optimize-css-assets-webpack-plugin to remove comments: example

like image 160
Kristijan Tomić Avatar answered Oct 03 '22 13:10

Kristijan Tomić