cmayankc
cmayankc

Reputation: 61

how to bundle feature modules and load them on demand in angular2 app

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?

Upvotes: 2

Views: 320

Answers (1)

martin
martin

Reputation: 96959

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

Upvotes: 1

Related Questions