Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webpack: silence output

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:

output of terminal with 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.

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

like image 510
kentcdodds Avatar asked Jun 10 '15 12:06

kentcdodds


3 Answers

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

module.exports = {
 devServer: {
  stats: {
    colors: true,
    hash: false,
    version: false,
    timings: false,
    assets: false,
    chunks: false,
    modules: false,
    reasons: false,
    children: false,
    source: false,
    errors: false,
    errorDetails: false,
    warnings: false,
    publicPath: false
  }
 }
}
like image 180
TetraDev Avatar answered Oct 18 '22 05:10

TetraDev


👋 You don't need all that. All you need is the

Actually, these two work great.

stats: 'errors-only',

at the end of the exported object.

One could also use stats: 'minimal', it only outputs when errors or new compilation happen. Read more from the official documentation of Webpack.

like image 58
Ahmad Awais Avatar answered Oct 18 '22 07:10

Ahmad Awais


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!

like image 33
kentcdodds Avatar answered Oct 18 '22 07:10

kentcdodds