How To Analyze Angular App Bundle Sizes

1. First, build your app

1
ng build --prod --stats-json

This will add an extra dist/stats.json file that contains an analysis of the parts wrapped inside the bundle.

Bundle Analysis in Three Easy Steps

1. Install the tool with

1
npm install webpack-bundle-analyzer -D

2. Add a new script to your package.json file

1
"analyzer": "webpack-bundle-analyzer dist/stats.json"

3. Run

1
npm run analyzer

Related Posts

0 Comments

12345

    00