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:
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
.
Note: I tried noInfo: true
and quiet: true
but that didn't seem to do the trick.
Edit: I'm thinking this may not be possible, so I've created an issue on github: https://github.com/webpack/webpack/issues/1191
In my webpack config, Doing this reduced my incremental build time by 8 seconds and silenced output. The main one is
chunks: false
Play with it to fit your needs
If you are using the
webpack-dev-middleware
you can throw thenoInfo: true
in an object as the second parameter. Also assuming you also have a node/express server running.Cheers.
Webpack
Dev Server
Reference
https://webpack.js.org/configuration/stats/
Recommend stats config below, this will keep significant logs and remove useless info.
What you're interested in here is
stats
module (part) of the Webpack. Basically, it's this module that produces the output. The output by default mostly contains list of assets, and list of modules. You can hide modules with--hide-modules
directive. Regarding assets, no similar option exists. But there are presets. You can specify preset with--display
option. And preset that hides assets is...none
.There is another way to influence stats:
webpack.config.js
. Addstats: {assets: false, modules: false}
to reduce output significantly. Orstats: 'none'
to silence Webpack entirely. Not that I recommend it. Generallyerrors-only
is a way to go. To make it affectwebpack-dev-server
put it underdevServer
key.Webpack 2.x doesn't have
--display
option. And the only way to hide modules is--hide-modules
switch. By that I mean that specifyingstats: 'errors-only'
orstats: {modules: false}
in config has no effect. Since this piece of code overrides all that.For
webpack-dev-server
there are also--no-info
and--quiet
options.Some more insight into how it works.
webpack-cli
createsoutputOptions
object. When compilation finishes, it converts stats to string and outputs it.Stats.toString
converts stats to json, then converts json to string. Here you can see the defaults.