4f37487b1c
There has been a regression where enabling rollup treeshaking causes errors during runtime because it will drop const access which will always evaluate to true or false. However, such `const` in `@angular/core` cannot be dropped because their value is changed when NGCC is run on `@angular/core` VE ``` const SWITCH_IVY_ENABLED__POST_R3__ = true; const SWITCH_IVY_ENABLED__PRE_R3__ = false; const ivyEnabled = SWITCH_IVY_ENABLED__PRE_R3__; ``` Ivy (After NGCC) ``` const SWITCH_IVY_ENABLED__POST_R3__ = true; const SWITCH_IVY_ENABLED__PRE_R3__ = false; const ivyEnabled = SWITCH_IVY_ENABLED__POST_R3__; ``` FESM2015 ``` load(path) { /** @type {?} */ const legacyOfflineMode = this._compiler instanceof Compiler; return legacyOfflineMode ? this.loadFactory(path) : this.loadAndCompile(path); } ``` ESM2015 ``` load(path) { /** @type {?} */ const legacyOfflineMode = !ivyEnabled && this._compiler instanceof Compiler; return legacyOfflineMode ? this.loadFactory(path) : this.loadAndCompile(path); } ``` From the above we can see that `ivyEnabled ` is being treeshaken away when generating the FESM bundle which is causing runtime errors such as `Cannot find module './lazy/lazy.module.ngfactory'` since in Ivy we will always load the factories. PR Close #32069 |
||
---|---|---|
.. | ||
animations | ||
bazel | ||
benchpress | ||
common | ||
compiler | ||
compiler-cli | ||
core | ||
docs | ||
elements | ||
examples | ||
forms | ||
http | ||
language-service | ||
platform-browser | ||
platform-browser-dynamic | ||
platform-server | ||
platform-webworker | ||
platform-webworker-dynamic | ||
private/testing | ||
router | ||
service-worker | ||
upgrade | ||
zone.js | ||
BUILD.bazel | ||
README.md | ||
empty.ts | ||
goog.d.ts | ||
license-banner.txt | ||
system.d.ts | ||
tsconfig-build-no-strict.json | ||
tsconfig-build.json | ||
tsconfig-test.json | ||
tsconfig.json | ||
types.d.ts |
README.md
Angular
The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.
License: MIT