Header Ads Widget

Responsive Advertisement

Optimize angular bundle size and decrease initial pages loading time


Optimize angular bundle size and decrease first-time pages loading time by following simple steps.

Step 1: Know your bundle size

  • Open the new terminal of Visual Studio Code
  • Run the command ng build --prod
  • Review your bundle size

Step 2: gzip your files

Step 3: Analyze your bundle size

Step 4: Monitor your bundle size

Note: Many solutions are available to optimize your bundle size, I find the simple solution define below.

I use that command to optimize my bundle size and make the application first-time page loading fast.

ng build --prod --aot --vendor-chunk --common-chunk --delete-output-path --buildOptimizer

Post a Comment