Angular main.js file large size

VinoPravin picture VinoPravin · Apr 23, 2019 · Viewed 15.3k times · Source

My project user angular version 7, and here is the angular.json configuration enter image description here

when I build for production my main.js file is way too large nearly 12MB in size which makes my app to load the page very slowly. Nearly the initial load tooks 4 - 5 minutes

Here is the build result enter image description here

Here is my analyser result enter image description here

Thanks in advance

Answer

Prashanthi picture Prashanthi · Apr 23, 2019

Split the file which is taking too much into modules and apply lazy loading