This repository has been archived by the owner on Aug 7, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 49
fix(angular): support angular lazy routes in preview #753
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b042c65
to
39c7a6c
Compare
sis0k0
suggested changes
Dec 20, 2018
fe26d49
to
b2747e0
Compare
sis0k0
reviewed
Dec 20, 2018
803afe1
to
b6d49dc
Compare
sis0k0
approved these changes
Dec 20, 2018
…loader in the bundle when angular/core is external
…invalid import in JS applications
af8b635
to
f7641dc
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
What is the current behavior?
When an Angular app with lazy routes is run with
preview
, all Angular dependencies are marked asexternal
and the app crashes runtime because the@angular/core NgModuleFactoryLoader
is located innode_modules
and it's not able to load the lazy routes from inside the app bundle.What is the new behavior?
When
@angular/core
is an external module, a newng-replace-lazy-loader
transformer is added to the@ngtools/webpack
platformTransformers
. It modifies the main Angular module by including and providing a localNgModuleFactoryLoader
.In this way, when an Angular app with lazy routes is run with
preview
, it gets a localNgModuleFactoryLoader
implementation inside the app bundle allowing it to access and load the lazy routes.Related to: NativeScript/nativescript-cli#4024