Create-react-app: Build size info

Created on 5 Oct 2016  路  5Comments  路  Source: facebook/create-react-app

Would it be useful to try and give a breakdown of the build size when you build? Sometimes I include a few libraries and the bundle size balloons out and I'm not too sure why, and with create-react-app wrapping webpack it's a bit cumbersome to run these tools eg webpack-bundle-size-analyzer.

Is it worth looking into some way of displaying this when npm run build is used, similar to how gzip size is shown now?

Most helpful comment

Seems source-map-explorer is a more accurate way of seeing built module size.

The data looks like this (from the visual tool).
source-map-explorer

All 5 comments

Seems source-map-explorer is a more accurate way of seeing built module size.

The data looks like this (from the visual tool).
source-map-explorer

Example build output

File sizes after gzip:

  134.87 KB  build/static/js/main.195ff791.js
  1.4 KB     build/static/css/main.3a26db49.css

Dependencies

  35% (50 KB)  immutable-js
  32% (30 KB)  moment-js
  21% (25 KB)  react-js
  ...

I had also some similar proposal, see here #798.

Ah, missed that. Seems analysing the js map wasn't mentioned though, it seems like a more accurate way of determining the sizes over the pre-webpack build sizes.

@tbillington This sounds reasonable! I鈥檒l close in favor of #798 but you are welcome to submit a pull request implementing what you suggested.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ap13p picture ap13p  路  3Comments

rdamian3 picture rdamian3  路  3Comments

dualcnhq picture dualcnhq  路  3Comments

Aranir picture Aranir  路  3Comments

Evan-GK picture Evan-GK  路  3Comments