webpack.config_.dev_.js
//...
devServer: {
host: '0.0.0.0',
port: WEBPACK_PORT,
watchOptions: {
aggregateTimeout: 300,
poll: true
},
stats: {
assets: false,
children: false,
colors: true,
version: false,
hash: false,
timings: true,
chunks: false,
chunkModules: false,
warningsFilter: '[mini-css-extract-plugin]'
},
headers: {
'Access-Control-Allow-Origin': '*'
}
Webpack config stats docs I'm going off of:
https://webpack.js.org/configuration/stats/#stats
WDS stats docs:
https://webpack.js.org/configuration/dev-server/#devserver-stats-
While using stats.warningsFilter in my configuration, then it would be respected by webpack-dev-server, and that errors of anything from stats.warningsFilter would be filtered out and not posted to my browser's console. The closest to addressing logging that I can find in your code is this line, or several other lines that check for stats.colors from the same file.
Note: I _am_ certain that my stats are connected correctly, because setting my stats.colors to false turns the colors off.
When adding warningsFilter: '[mini-css-extract-plugin]' to my config, errors from Webpack-Dev-Middleware are respected, and I no longer see them:
[webpack] ℹ 「wdm」: Compiled with warnings.
However, I am still getting my warnings in the browser's console:

Which is originating from https://github.com/webpack/webpack-dev-server/blob/55398b5de17b9a845b1ee5aaa90bb2002c25ddfb/client-src/default/index.js#L145
Hmm I guess you'd need to set up a warning that you would try to filter out with your webpack config. Open browser console, errors persist with each page reload.
Note: when I update webpack-dev-server to latest version (3.1.10), problem still persists.
Thank you in advance!
@missalyss looks like a bug, feel free to investigate and send a PR
@evilebottnawi to your knowledge, does your client have access to webpack config at all? I've been trying to send it from bin/webpack-dev-server, but it doesn't want to read it.
@evilebottnawi
I have also encountered this problem, except the warnings are from a different loader (ts-loader).
Setting a proper stats.warningsFilter, as described in ts-loader doc, does eliminate the warning from terminal output, but not from browser console.
I found the root cause is browser console log is collected using a hard-coded stats option without consulting the stats option from config at all. See code at
Maybe we could fixed it by merging the hard-coded stats option with the one passed in constructor.
Should be fixed, but we need add test for warningsFilter option as described in original issue
@evilebottnawi I'm making the PR... totally forgot about that test.
@yoannmoinet will be great, thanks!
Here you go @evilebottnawi https://github.com/webpack/webpack-dev-server/pull/1732
@evilebottnawi Thanks!
Do you know when there will be a release?
In near future
Thx for this @yoannmoinet ! Can't wait to get it!
Most helpful comment
In near future