8

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?

licaomeng
  • 919
  • 2
  • 13
  • 27

5 Answers5

5

You can use:

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

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

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Ruslan
  • 51
  • 1
  • 1
4

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',
},
Patrick
  • 6,495
  • 6
  • 51
  • 78
2

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

GRAMMAC
  • 21
  • 1
2

Webpack v5

The "most silent" configuration:

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

Docs: infrastructureLogging, stats.

lonix
  • 14,255
  • 23
  • 85
  • 176
0

You should use

stats: 'errors-only'

in your webpack-dev-server config

Anton
  • 1