analyze-cra-bundle
📦
Keep an eye on your Create React App bundle size Assess impact of new code/deps on the end-user initial bundle size and monitor it directly in your Pull Request changes via TravisCI.
It makes sure to track only CRA JS chunks present in index.html.
Installation
$ yarn add --dev analyze-cra-bundle
Usage
$ analyze-cra-bundle
OPTIONS
-f, --buildFolderPath=buildFolderPath [default: build]
-h, --help show help
-v, --version show version
yarn build && analyze-cra-bundle
TravisCI Integration
Keep an eye on the bundle size in your Pull Requests with a extra status check
- Add a Github Access Token as
ANALYZE_CRA_GITHUB_TOKEN
to your environment variables in the TravisCI project settings. - Add the script
"bundlesize": "analyze-cra-bundle"
to yourpackage.json
scripts - Add
- yarn bundlesize
to your.travis.yml
withinscript:
(Create an issue if you're having trouble with this!)