2

I am working on an angular2 application, where I want to use lazy loading of feature modules. Separating modules as feature modules and loading them on demand works fine in dev mode, but how do I bundle feature modules separately(using systemjs) and load them in production?

martin
  • 93,354
  • 25
  • 191
  • 226
cmayankc
  • 61
  • 5

1 Answers1

1

It's hard to give any advice from such short description. SystemJS has a tool called SystemJS Builder that can bundle multiple SystemJS modules into a single bundle (a single file with multiple modules).

Then SystemJS has an option bundle option to load bundles made by SystemJS Builder.

See a similar question with example of SystemJS Builder: Build Angular2 HTML and TypeScript to a single file

Community
  • 1
  • 1
martin
  • 93,354
  • 25
  • 191
  • 226
  • My question is about creating multiple bundles for each feature module for example, two separate bundles for hero and crisis app in tour of heroes app. I am using systemjs builder and I am able to create bundles (revisioned) using bundle arithmetic, now the question is that how to provide system js bundle configuration so that I can load these bundles on demand. – cmayankc Nov 08 '16 at 14:39