简体   繁体   中英

Angular2 SystemJs, Ahead of Time Compilation with Gulp

Can anyone please guide how to use Gulp for Ahead of Time compilation of a Angular2 project that uses SystemJs. I mean to automate all steps mentioned in https://angular.io/docs/ts/latest/cookbook/aot-compiler.html

ie generate NgFactories, Treeshaking and bundling?

You do not need to use gulp for that. You just "hide" the commands behind an npm "package.json" script command. (If you really want to fire cmd with gulp you can use the shell js gulp plugin for example). After you have the output of AoT you need any tool which takes the output and can work with that. You have to create bundles to get the application in production state. Therefore you can use rollup.js or webpack. You do not need to take gulp anymore. However, there are gulp-rollup and gulp-webpack plugins out there. But using webpack or rollup.js after doing AoT without gulp should give you what you want.

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