Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to make webpack not show all the chunks it's compiling?

Tags:

The default webpack CLI output is way too verbose for my liking. As soon as I import React from one of my files, the output explodes, showing all of the chunks (?) being packed:

webpack result is served from / content is served from /Users/me/myproject Hash: aaaf5afc6582f3222f55 Version: webpack 1.12.14 Time: 1175ms    Asset    Size  Chunks             Chunk Names index.js  677 kB       0  [emitted]  main chunk    {0} index.js (main) 643 kB [rendered]     [0] ./src/app.js 574 bytes {0} [built] [1 error]     [1] ./~/react/react.js 56 bytes {0} [built]     [2] ./~/react/lib/React.js 1.49 kB {0} [built]     [3] ./~/react/lib/ReactDOM.js 3.71 kB {0} [built]     [4] ./~/process/browser.js 2.06 kB {0} [built]  ...    [155] ./~/fbjs/lib/mapObject.js 1.47 kB {0} [built]   [156] ./~/react/lib/onlyChild.js 1.21 kB {0} [built]   [157] ./~/react/lib/deprecated.js 1.77 kB {0} [built]   [158] ./~/react-dom/index.js 63 bytes {0} [built]   [159] ./src/component.js 339 bytes {0} [built] [1 error] 

I really don't care about all of that extra information. I'd be happy with a way to either:

  • Disable the chunks altogether, just showing the overall progress
  • Only show my own code, not stuff I'm importing from my node_modules

At the moment my webpack command is webpack-dev-server --progress. My webpack config is pretty basic, just specifying entry, output, and loaders for babel and eslint.

like image 870
Cam Jackson Avatar asked Mar 11 '16 07:03

Cam Jackson


People also ask

What is split chunks in webpack?

splitChunks.If the current chunk contains modules already split out from the main bundle, it will be reused instead of a new one being generated. This can affect the resulting file name of the chunk. webpack.config.js module.

Does webpack automatically minify?

Webpack v4+ will minify your code by default in production mode .

How do I turn off webpack watch?

Type: Ctrl+C once.


1 Answers

From the command line, I haven't been able to find a way to do this.

However, if you have a webpack.config.js file, there are two options for suppressing the list of modules ..

devServer: {     stats: 'errors-only' } 

or

devServer: {     stats: { chunks: false } } 

Hope that helps.

like image 169
freethebees Avatar answered Oct 06 '22 00:10

freethebees