angular-fullstack / generator-angular-fullstack

Yeoman generator for an Angular app with an Express server
https://awk34.gitbook.io/generator-angular-fullstack
6.12k stars 1.24k forks source link

Is it possible to use ocLazyLoad ? #2601

Open ajai-jayakumar opened 7 years ago

ajai-jayakumar commented 7 years ago
Item Version
generator-angular-fullstack 4.1.1
Node 6.10.0
npm 3.10.10
Operating System Ubuntu 14.01
Item Answer
Transpiler Babel
Markup HTML
CSS SCSS
Router ui-router
DB MongoDB
Auth Y

Hi, Instead of bundling the entire project into a single app.bundle.js I wanted to load files based on routes, say admin files should load when I am in admin route, homepage files when in homepage route and so on. When I searched I found ocLazyLoad can this be integrated with this generator or any other in-build functions are available in the generator itself .

Awk34 commented 7 years ago

Yes, you can. You would need to use ocLazyLoad along with Webpack's code-splitting to create separate bundles that Angular can then lazily load.