简体   繁体   中英

Angular 2 CLI, Webpack in production

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM