webpack-hot-middleware icon indicating copy to clipboard operation
webpack-hot-middleware copied to clipboard

Disable warnings in console?

Open peteruithoven opened this issue 8 years ago • 7 comments
trafficstars

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.

peteruithoven avatar Jul 24 '17 11:07 peteruithoven

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

nickgcattaneo avatar Sep 22 '17 08:09 nickgcattaneo

@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 avatar Nov 15 '17 16:11 okcoker

@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 avatar Dec 14 '17 05:12 jarodccrowe

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

You're speaking of the client warnings right?

okcoker avatar Dec 14 '17 05:12 okcoker

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

okcoker avatar Dec 14 '17 05:12 okcoker

@okcoker Thx, &quiet=true works!

squidbe avatar Mar 06 '18 21:03 squidbe

edit webpack like this

 ...
entry: ['webpack-hot-middleware/client.js?quiet=true'],
....

ebrahimiaval avatar Jul 17 '18 09:07 ebrahimiaval