A lot of warnings with webpack uglify

2019-06-19 08:59发布

问题:

When I'm running webpack uglify plugin and I'm getting a lot of warnings from the stylus loader / css-loader. How can I resolve them? The webpack bundles it successfully.

   Condition always true [./~/style-loader!./~/css-loader!./~/stylus-loader!./app/<filename>.styl:10,0]

回答1:

That's normal -- by default Uglify tells you about the dead code that it strips out. If you don't want those "warnings" output, you can configure the plugin not to:

new Webpack.optimize.UglifyJsPlugin({ 
    compress: {
        warnings: false
    }
});