Support for '--profile' option for webpack from react-scripts build
See original GitHub issueWe had a problem this week where we may have let our production dependencies get a bit out of control and the output from yarn build
jumped up in file size as well as time-to-generate.
To diagnose what might have been at fault, I dug around for a bit and found a profile option for webpack. The resulting json I was able to visualise in webpack-analyse and webpack-bundle-analyzer and compare with earlier commits. The latter provided a fairly useful tree map that helped us work out what had happened.
However, to run this my only option was to eject, or to run with the webpack conf directly:
NODE_ENV=production ./node_modules/webpack/bin/webpack.js --config node_modules/react-scripts/config/webpack.config.prod.js --profile --json
I feel like it would be useful to have --profile options for webpack available from react-scripts. The stats produced feel like they would be useful even if you were not doing anything complicated with your webpack setup. I guess it could be similar to react-scripts test and how it passes through options to jest. Actually this was my first guess when I was seeing if it was supported
yarn build -- --profile --json
cheers
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:8 (5 by maintainers)
Seems like the tools mentioned above are sufficient. Thanks for the issue though!
You can actually use https://www.npmjs.com/package/source-map-explorer without the need to eject.