Skip to content

@angular-devkit/build-angular: separate differential loaded chunks in build output to fix Initial Total size #19330

@eneajaho

Description

@eneajaho

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Description

When using ng build --prod to build an application. For example, the results will be shown like this:

Initial Chunk Files                                                                          | Names                                                         |      Size
vendor-es5.a0c3454d19ff86f83933.js                                                           | vendor                                                        | 836.90 kB
vendor-es2015.a0c3454d19ff86f83933.js                                                        | vendor                                                        | 722.77 kB
styles.7ee5235ef5fc467fa3ae.css                                                              | styles                                                        | 146.75 kB
polyfills-es5.18287c60ab9ba45f94a3.js                                                        | polyfills-es5                                                 | 128.72 kB
main-es5.666969bea863a34fa0f6.js                                                             | main                                                          |  41.49 kB
main-es2015.666969bea863a34fa0f6.js                                                          | main                                                          |  38.51 kB
polyfills-es2015.bc4f9cbda07960febcbe.js                                                     | polyfills                                                     |  36.12 kB
runtime-es2015.0703668feea579572ec2.js                                                       | runtime                                                       |   2.45 kB
runtime-es5.0703668feea579572ec2.js                                                          | runtime                                                       |   2.45 kB

                                                                                             | Initial Total                                                 |   1.91 MB

Lazy Chunk Files                                                                             | Names                                                         |      Size
pages-settings-settings-module-es5.b1d6a58e304667332cea.js                                   | pages-settings-settings-module                                |  20.41 kB
pages-settings-settings-module-es2015.b1d6a58e304667332cea.js                                | pages-settings-settings-module                                |  18.10 kB
auth-auth-module-es5.0cd7e362716401cb882f.js                                                 | auth-auth-module                                              |  15.26 kB
auth-auth-module-es2015.0cd7e362716401cb882f.js                                              | auth-auth-module                                              |  14.53 kB

The Initial Total size is the sum of all Initial Chunk Files (both es5 and es2015). It is misguiding.
Wouldn't be better if we had Initial Total Sizes for different kinds of ECMAScript targets?

🌍 Your Environment


Angular CLI: 11.0.0-rc.2
Node: 12.13.1
OS: win32 x64

Angular: 11.0.0-rc.3
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1100.0-rc.2
@angular-devkit/build-angular   0.1100.0-rc.2
@angular-devkit/core            11.0.0-rc.2
@angular-devkit/schematics      11.0.0-rc.2
@angular/cli                    11.0.0-rc.2
@schematics/angular             11.0.0-rc.2
@schematics/update              0.1100.0-rc.2
rxjs                            6.5.5
typescript                      4.0.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions