⚠️⚠️⚠️
This is NOT the proposed solution to lazy load modules with Angular router! It is a demo for the Angular CLI issue mentioned further down in the README.
⚠️⚠️⚠️

Official workaround: angular/angular-cli#6373 (comment)

DemoLazyRouteComponents

A workaround example to lazy load Angular CLI libraries within Angular CLI applications.

For more info please read the comment in Angular CLI issue.

Run the application

Execute the following commands:

  • git clone git@github.com:klemenoslaj/angular-demo-lazy-route-libraries.git && cd angular-demo-lazy-route-libraries
  • npm install
  • ng build lazy-component
  • ng serve --aot (NOTE: the workaround only works with AOT enabled for now)

NOTE: if Angular CLI is not installed globally, run npm run ng instead of ng only.