Create-react-app: Add some analyze script for npm packages

Created on 29 Sep 2016  路  9Comments  路  Source: facebook/create-react-app

Hi,
I would love to have some anylyze script that would print out size for individual package bundled with webpack.
Something like I read here: http://stackoverflow.com/questions/34700844/how-can-i-find-out-the-size-of-the-included-packages-with-webpack-or-npm

proposal

Most helpful comment

Alternatively we can just output build/stats.json and tell people to use webpack analyzer with it.

This is what we do at react-boilerplate, see our analyze.js script (which is invoked with the npm run analyze command) and feel free to copy it!

All 9 comments

Agree this would be nice but not sure what approach would be most useful.
Maybe if you could submit a proof of concept we could iterate on it.
Alternatively we can just output build/stats.json and tell people to use webpack analyzer with it.

stats.json also sounds good, just need to view what kind of info each
produces so we see what kind of info suits the majority. Will look into it.

Alternatively we can just output build/stats.json and tell people to use webpack analyzer with it.

This is what we do at react-boilerplate, see our analyze.js script (which is invoked with the npm run analyze command) and feel free to copy it!

Is this still a discussion? I was thinking of trying and implementing what @mxstbr mentioned.

Feel free to send a PR!
I鈥檓 a bit behind the issues right now but maybe other maintainers can provide feedback.

I added webpack bundle analyzer since it gives you a lot more information if we want to run stats on our bundle. I sent first PR https://github.com/facebookincubator/create-react-app/pull/2359, however CI is failing on node 6. Any clue?

Guys, I highly recommend the Bundle Buddy tool from @samccone

https://twitter.com/franklinjavier/status/931324987654443008?s=17

A bit of a hack, but you can create your own very simple script that appends the webpack-bundle-analyzer plugin to the config without ejecting. I wrote about it here: https://github.com/facebookincubator/create-react-app/issues/3518

Closing in favor of more recent discussion in https://github.com/facebookincubator/create-react-app/issues/1858.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

onelson picture onelson  路  3Comments

adrice727 picture adrice727  路  3Comments

alleroux picture alleroux  路  3Comments

dualcnhq picture dualcnhq  路  3Comments

oltsa picture oltsa  路  3Comments