Description
Bug Report or Feature Request (mark with an x
)
- bug report -> please search issues before submitting
Versions.
@angular/cli: 1.2.1
node: 8.1.4
os: win32 x64
@angular/animations: 4.1.3
@angular/common: 4.1.3
@angular/compiler: 4.1.3
@angular/core: 4.1.3
@angular/forms: 4.1.3
@angular/http: 4.1.3
@angular/platform-browser: 4.1.3
@angular/platform-browser-dynamic: 4.1.3
@angular/platform-server: 4.1.3
@angular/router: 4.1.3
@angular/cli: 1.2.1
@angular/compiler-cli: 4.1.3
Windows 10
Repro steps.
The commons chunk update that occurred here causes a performance regression 2090f64
The use case, we have three NgModules. Module A, B and C. All three are lazy loaded separately quite large at 50kb each. Module C is lazy loaded but depends on Module A and B. Because Module C depends on A and B the modules are moved into a common chunk and leaves the lazy loaded modules empty with just the module definition code. Now module A, B and C are now all bundled into a common bundle and no longer lazy loaded. Now when user navigates to Feature A all 150kb of feature A, B and C are loaded.
Not sure if there is a fix to this or our best option is to eject. Maybe proposal to make the common chunk optional behind a config? The common bundle removed duplicated code but essentially removed the benefit of lazy loaded modules if one of those happens to depend on each other.
In certain apps with certain use cases having common chunks configurable would be necessary. It would seem that larger apps would likely run into our similar use case.
The log given by the failure.
Desired functionality.
Would be glad to get a pull request to make this optional in the CLI.