Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide webpack-dev-server log?

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?

like image 793
licaomeng Avatar asked Apr 19 '26 20:04

licaomeng


2 Answers

For anyone coming 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',
},
like image 185
Patrick Avatar answered Apr 22 '26 22:04

Patrick


You can use:

devServer: {
  client: {
    logging: 'none'
  }
}

doc: https://webpack.js.org/configuration/dev-server/#logging

like image 21
Ruslan Avatar answered Apr 22 '26 23:04

Ruslan