Webpack: Squelch uglify warnings for node_modules

Created on 7 Oct 2015  路  3Comments  路  Source: webpack/webpack

Running webpack -p results in hundreds of dead code warnings for React code I'm pulling in from node_modules. Because I am using the define plugin, these are to be expected, but they make it difficult to find warnings being thrown regarding my own code.

Does anyone know of a way to silence warnings for code originating from node_modules? If not, is there any plan to implement such a feature?

Nice To Have Confusing work required (PR / Help Wanted) enhancement

Most helpful comment

hope this may help you @dubrowgn @wchargin

All 3 comments

:+1:, I too would like this feature.

You can use

new webpack.optimize.UglifyJsPlugin({
    compress: {
        warnings: false,
    },
})

but then, like you said, you'll miss warnings for your own code, too.

Sounds good. You can send a PR. Try to use warnings.test warings.include and warnings.exclude.

hope this may help you @dubrowgn @wchargin

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sairion picture sairion  路  3Comments

natew picture natew  路  3Comments

shairez picture shairez  路  3Comments

andersekdahl picture andersekdahl  路  3Comments

IngwiePhoenix picture IngwiePhoenix  路  3Comments