-1

I just built my first angular site and the deployment bundle seems rather large. I ran source-map-explorer and it generated the following graphic. It's swell that now I know where all of the space is but I'm not quite sure how to go about reducing the file size.

Could you please take a look and let me know if you see anything that could be improved?

enter image description here

prizeant
  • 52
  • 5
  • Does this answer your question? [How to decrease prod bundle size?](https://stackoverflow.com/questions/41432673/how-to-decrease-prod-bundle-size) – R. Richards Jan 25 '21 at 21:08

1 Answers1

1

You can start by creating as small as possible modules,

Angular modules are not tree shakable (all the code in the module is part of the bundle even if you haven't used all of it). Split your modules in a way that each module declares as less components as possible.

If you are using Angulars router use lazy loaded modules:

https://angular.io/guide/lazy-loading-ngmodules

misha1109
  • 358
  • 2
  • 5