Are you see that implementantion?
http://blog.mgechev.com/2015/09/30/lazy-loading-components-routes-services-router-angular-2/
Well, this is quite easy to implement. This basic article is use SystemJS to load modules async (which in our case replaced by webpack), so any difference - is how you will load modules.
For webpack you may need something like '@angularclass/webpack-toolkit' which provide you a toolkit for lazy load. Take a look on _https://github.com/AngularClass/angular2-webpack-starter/blob/master/src/app/app.routes.ts_ this one. You only need to make sure that it will fit in your current setup.
If you think about to lazy load already preload component, than it possible, but for sure NOT reasonable.
The AngularClass/angular2-webpack-starter is a good referencial project. May we put the webpack-toolkit for lazy load in this project at Yeoman generator.
Preload lazy load resources like components and routes dependences? It is not interesting I guess.
It good option but adding it to template will enforce everyone to use it. This is not quite what everyone needed, just some of them :), so probably may be article of how to do so be enough?
Nice, an article is enough. I missing also, some tutorial to add a Gulp tools or something like that to run some tasks like a concat js and css files.
Thanks!
With webpack you don't actually need for such tool. Just create proper bundle
Thanks @alexsandro-xpt!
I did read that post (http://blog.mgechev.com/2015/09/30/lazy-loading-components-routes-services-router-angular-2/) a long time ago when trying to figure out whether we could do lazy loading in the Angular 2 template. The mechanism described there looks excessively complex and risky to be used in a general-purpose template as this, plus I don't know how well it still applies to current builds of Angular 2, which have changed enormously since September 2015 when that post was written.
Hopefully the final version of Angular 2 will have a supported native method of doing lazy loading!
Most helpful comment
Thanks @alexsandro-xpt!
I did read that post (http://blog.mgechev.com/2015/09/30/lazy-loading-components-routes-services-router-angular-2/) a long time ago when trying to figure out whether we could do lazy loading in the Angular 2 template. The mechanism described there looks excessively complex and risky to be used in a general-purpose template as this, plus I don't know how well it still applies to current builds of Angular 2, which have changed enormously since September 2015 when that post was written.
Hopefully the final version of Angular 2 will have a supported native method of doing lazy loading!