Webpack-hot-middleware: Disable warnings in console?

Created on 24 Jul 2017  路  7Comments  路  Source: webpack-contrib/webpack-hot-middleware

My bundle generates warnings that I'd like to hide / filter for the moment. I've set the webpackDevMiddleware's stats's warnings option to false, but the warnings are still shown in the browser console:

[HMR] bundle has 13 warnings
...

Do those stats settings influence what's send to the HMR client? Shouldn't they?

What's the best way to hide these warnings but still get the other information. I prefer not using the noInfo since that might hide more information than just those warnings.

Most helpful comment

Actually you might want to try &quiet=true instead of &warn=false as seen here

All 7 comments

Looks like as far as the client.js goes, the server side options do not get passed to the client side options.

@peteruithoven When including the hot-middleware/client file in your bundle, make sure you have the warn=false parameter added like so:

webpack-hot-middleware/client?path=/__webpack_hmr&warn=false

Server options and client options are separate in case you wanted to suppress warnings in your terminal and not your browser console or visa versa.

@okcoker That didn't work for me, I commented out the code in the node module displaying the warnings. Would be nice if it worked though so I didn't have to do that.

@jarodccrowe if warn is false, then log won't get called as seen here

You're speaking of the client warnings right?

Actually you might want to try &quiet=true instead of &warn=false as seen here

@okcoker Thx, &quiet=true works!

edit webpack like this

 ...
entry: ['webpack-hot-middleware/client.js?quiet=true'],
....
Was this page helpful?
0 / 5 - 0 ratings

Related issues

sarincasm picture sarincasm  路  6Comments

erikakers picture erikakers  路  11Comments

moshie picture moshie  路  3Comments

benjarwar picture benjarwar  路  10Comments

Yizhachok picture Yizhachok  路  6Comments