How to decrease prod bundle size?

后端 未结 14 1348
Happy的楠姐
Happy的楠姐 2020-11-28 01:31

I have a simple app, initialized by angular-cli.

It display some pages relative to 3 routes. I have 3 components. On one of this page I use lodash

14条回答
  •  时光取名叫无心
    2020-11-28 01:55

    This did reduce the size in my case:

    ng build --prod --build-optimizer --optimization.
    

    For Angular 5+ ng-build --prod does this by default. Size after running this command reduced from 1.7MB to 1.2MB, but not enough for my production purpose.

    I work on facebook messenger platform and messenger apps need to be lesser than 1MB to run on messenger platform. Been trying to figure out a solution for effective tree shaking but still no luck.

提交回复
热议问题