最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to hide webpack-dev-server log? - Stack Overflow

programmeradmin11浏览0评论

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 all stats properties, but still not work, could you please point out the detail configuration? – licaomeng Commented May 21, 2020 at 8:54
Add a ment  | 

5 Answers 5

Reset to default 6

For 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

发布评论

评论列表(0)

  1. 暂无评论