webpack-hot-middleware
webpack-hot-middleware copied to clipboard
Disable warnings in console?
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.
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'],
....