Angular 2 rc 6
written in Typescript 2.0.2
I\'m trying to learn Ahead-of-Time compilation as outlined here. It seems simple enough:
This is the cross-platform version of the gulpfile, which I am currently using for Ahead-Of-Time (AOT) compilation with angular 2:
//jshint node:true
//jshint esversion: 6
'use strict';
...
// helper function for running ngc and tree shaking tasks
const run_proc = (cmd, callBack, options) => {
process.stdout.write(stdout);
process.stdout.write(stderr);
callBack(err);
});
};
gulp.task('ngc', ['css', 'html', 'ts'], cb => {
let cmd = 'node_modules/.bin/ngc -p tsconfig-aot.json';
if (isWin) {
cmd = '"node_modules/.bin/ngc" -p tsconfig-aot.json';
}
return run_proc(cmd, cb);
});
Feel free to check out the entire example of the Tour of Heroes (ToH) example with gulp.js on my github repo: ng2-heroes-gulp
This is for sure the short term solution, the long term solution for me will be the gulp-ngc plugin.