Once webpack-dev-server start, the console will output:
ℹ 「wds」: Project is running at https://127.0.0.1:3002/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from ...
However, I am not willing to display the above log to users, how to hide them?
Once webpack-dev-server start, the console will output:
ℹ 「wds」: Project is running at https://127.0.0.1:3002/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from ...
However, I am not willing to display the above log to users, how to hide them?
Share Improve this question asked May 21, 2020 at 8:15 licaomenglicaomeng 9472 gold badges14 silver badges28 bronze badges 4- 1 Who is your "user" that'll see that…? The dev server is a developer tool… – deceze ♦ Commented May 21, 2020 at 8:17
- My teammates and I :-) – licaomeng Commented May 21, 2020 at 8:17
- this might help: stackoverflow./questions/30756804/webpack-silence-output – Alexandar Zaharyan Commented May 21, 2020 at 8:30
-
@AlexandarZaharyan I've tried
noInfo: true
,quiet: true
, and nearly allstats
properties, but still not work, could you please point out the detail configuration? – licaomeng Commented May 21, 2020 at 8:54
5 Answers
Reset to default 6For anyone ing here in regards to webpack-dev-server v4,
As per the v4 migration guide:
log, logLevel, logTime, quiet, noInfo, and reporter options were removed without replacement, now we use built-in logger.
So you need to add this to your Webpack config:
infrastructureLogging: {
level: 'error',
},
You can use:
devServer: {
client: {
logging: 'none'
}
}
doc: https://webpack.js/configuration/dev-server/#logging
in my case
const devServer = new webpackDevServer(plier ,{
// quiet: true,
noInfo: true,
hot: true,
historyApiFallback: true,
clientLogLevel: 'silent'
})
set noInfo
work well. but with quiet
wds log still show, I dont know why
Webpack v5
The "most silent" configuration:
infrastructureLogging: { level: 'error' },
stats: 'minimal',
Docs: infrastructureLogging
, stats
.
You should use
stats: 'errors-only'
in your webpack-dev-server config