Webpack:静音输出 [英] Webpack: silence output

查看:31
本文介绍了Webpack:静音输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有一个配置选项可以告诉 webpack 只将重要信息"记录到终端.几乎只是错误和警告,而不是所有这些:

I would like to know if there's a configuration option to tell webpack to only log the "important information" to the terminal. Pretty much just errors and warnings, not all of this:

输出太多了!很想抑制常见的东西,只让 webpack 输出警告/错误.想要 webpackwebpack-dev-serverkarma-webpack 的解决方案.

There's just so much output! Would love to suppress the common stuff and only have webpack output the warnings/errors. Would like a solution for webpack, webpack-dev-server, and karma-webpack.

注意:我尝试了 noInfo: truequiet: true 但这似乎没有用.

Note: I tried noInfo: true and quiet: true but that didn't seem to do the trick.

我认为这可能是不可能的,所以我在 github 上创建了一个问题:https://github.com/webpack/webpack/issues/1191

I'm thinking this may not be possible, so I've created an issue on github: https://github.com/webpack/webpack/issues/1191

推荐答案

我不知道这个功能是什么时候添加的,但我只是在 文档,您可以添加 webpackMiddleware 属性,并在其上指定 noInfo: true.这样做可以消除所有噪音!但是当出现错误时,您仍然会看到输出.耶!

I don't know when this feature was added, but I just noticed in the docs that you can add a webpackMiddleware property and on that you can specify noInfo: true. Doing this removes all the noise! But you still see output when there are errors. Yay!

这篇关于Webpack:静音输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆