-
Notifications
You must be signed in to change notification settings - Fork 12k
Description
🐞 Bug report
Command (mark with an x
)
- new
- serve
- build
- test
- e2e
- generate
- add
- update
- lint
- xi18n
- run
- config
- help
- version
- doc
Is this a regression?
Yes, with Angular v8, or Ivy disabled, the main bundle size issue did not happen
Description
Like in issue #16146, Ivy enabled builds result in bigger main bundles.
We use an app-shell plus lazy load of components- with Angular Elements like in aio, and routes. With View Engine (VE), both in Angular 8 and 9, the main bundle effectively only included what was required to render the shell:
- Core framework,
- Auth back-end,
- Angular Material sidenav and toolbar,
- Shell components.
Once Ivy is enabled, it includes additional code. E.g., in one application, we get those two source-map-explorer results:
In other app, the result is also bigger main bundles. In particular, it adds all the @Injectable({providedIn: 'root})
services that are provided in a data-access internal library:
🔬 Minimal Reproduction
The issue is in a proprietary mono-repo of front-ends. We can provide access in Bitbucket or Github private repositories if necessary. To generate the bundles, we used
ng build <project-name> --prod --source-map --localize=false
And only changed the tsconfig.json to set angularCompilerOptions.enableIvy = false
🌍 Your Environment
Angular CLI: 9.0.0-rc.11
Node: 12.14.1
OS: linux x64
Angular: 9.0.0-rc.11
... animations, cli, common, compiler, compiler-cli, core
... elements, forms, language-service, localize
... platform-browser, platform-browser-dynamic, platform-server
... router, service-worker
Ivy Workspace: No
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.900.0-rc.11
@angular-devkit/build-angular 0.900.0-rc.11
@angular-devkit/build-ng-packagr 0.900.0-rc.11
@angular-devkit/build-optimizer 0.900.0-rc.11
@angular-devkit/build-webpack 0.900.0-rc.11
@angular-devkit/core 9.0.0-rc.11
@angular-devkit/schematics 9.0.0-rc.11
@angular/cdk 9.0.0-rc.8
@angular/material 9.0.0-rc.8
@angular/pwa 0.803.23
@ngtools/webpack 9.0.0-rc.11
@schematics/angular 8.3.23
@schematics/update 0.900.0-rc.11
rxjs 6.5.4
typescript 3.7.5
webpack 4.41.2