ng build -prod vs ng build --prod --build-optimizer=true

后端 未结 2 801
盖世英雄少女心
盖世英雄少女心 2020-12-28 15:51

My Angular project is @Angular4.3.3

ng build -prod

Takes 77 seconds to make a build

ng build --prod --bu

2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-28 16:25

    --build-optimizer and --vendor-chunk
    

    From Angular CLI Docs:

    When using Build Optimizer the vendor chunk will be disabled by default. You can override this with --vendor-chunk=true.

    Total bundle sizes with Build Optimizer are smaller if there is no separate vendor chunk because having vendor code in the same chunk as app code makes it possible for Uglify to remove more unused code.

提交回复
热议问题