Search code examples
angularbuildproduction-environment

Common size of basic app production bundle


I'm trying to build my first Angular 6 app for production, and the build size is around 1 MB.

Because of lack of the experience, it is hard for me to estimate what size it should be, but 1 MB seems to big for relatively small app.

How such an issue can be inspected?


Solution

  • You can analyze your bundle size with webpack-bundle-analyzer.

    If you're using Angular Cli, then you can build your project with ng build --prod --stats-json and it will create a stats.json file inside your dist folder.

    Then you can run webpack-bundle-analyzer dist/stats.json and it will show you the problematic areas.