-
Notifications
You must be signed in to change notification settings - Fork 25.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(router): extend support for lazy loading children #10705
Conversation
LGTM |
4b0e791
to
146d368
Compare
LGTM as well. |
@brandonroberts This will help in simplification of your AsyncNgModuleLoader, I think |
Yep. It actually removes the need for it which is great. Now you can On Aug 11, 2016 5:13 PM, "Sirajuddin Choudhary" [email protected]
|
be65301
to
c2bc40c
Compare
TAP Blocked |
c2bc40c
to
66e1a58
Compare
66e1a58
to
af67cea
Compare
ohhh does this mean that we can use webpack to generate bundles on its own again with the router ? |
@ocombe yep. No longer need a custom loader for webpack support. |
Can I see this in action anywhere? |
In webpack it's as simple as: const routerConfig: Routes = [{
path: '',
loadChildren: () => System.import('./Home').then(({HomeModule}) => HomeModule)
}] |
@ocombe thank you but now it says "System is not defined" ... do I need to do any changes to my webpack config? |
Ah my bad, System is only available in webpack 2, if you're using webpack 1 you can do: const routerConfig: Routes = [{
path: '',
loadChildren: () => new Promise(resolve => {
require.ensure([], require => {
resolve(require('./Home').HomeModule);
})
})
}] |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Closes #10659