Search code examples
angularangular-cli

Angular Project Build went from 12MBs to 90MBs after upgrading from angular 8


Build command currently using.

node pre-build && node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --prod --build-optimizer --outputHashing=all

Solution

  • In your angular.json try adjusting these properties

    optimization to true

    aot to true

    buildOptimizer to true

    It will enable optimizations like tree shaking and get rid of unnecessary code.