javascriptnode.jsnpmangular8ng-build

Angular : getting two main chunk (duplicate chunks) on build application


Whenever I do build / build --prod I'm getting duplicate chunks with "es5" and "es2015".

Can any one help me here to understand this?

  1. What is the reason for this?
  2. Will this increase the build size?

enter image description here


Solution

  • This is called differential loading from Angular 8.

    es5 bundles are for old browsers like IE.

    es6 bundles are for new browsers like Chrome etc.

    You can see es5 bundle size is bit heavy than es6 because es5 bundle used by IE require additional polyfills which actually wont be required for new browsers.

    The specific bundle will hit based on the browser. (So, no need to worry about bundle size)

    Earlier, only single bundle used to get generated which is used by all the browsers.

    Big shout out to Angular Team for bringing up this.