How to hide webpack-dev-server log?

Viewed 2358

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?

5 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',
},

in my case

const devServer = new webpackDevServer(complier ,{
  // 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

You should use

stats: 'errors-only'

in your webpack-dev-server config

Webpack v5

The "most silent" configuration:

infrastructureLogging: { level: 'error' },
stats: 'minimal',

Docs: infrastructureLogging, stats.

Related