0

I am working on an Angular2 application with large no of separate modules. I want to have separate bundle.js for each module instead of one.

I was able to do this before when separate config file for webpack was used but in new version of CLI there is no separate config file for webpack So how can I do it.

Lav Vishwakarma
  • 1,380
  • 14
  • 22

1 Answers1

0

You can setup your project with webpack directly without using angular-cli and use require.ensure() to include external file dynamically. Webpack will detect require.ensure and will create a seperate chunk for it.

shan kulkarni
  • 849
  • 7
  • 18