Extremely simple and dummy gulp plugin who wraps @angular/compiler-cli
In order to build your angular2 project with ngc simply pass path to your tsconfig.json file
Example:
import ngc from 'gulp-ngc';
gulp.task('ngc', () => {
return ngc('tsconfig.json');
});
More useful example:
import gulp from 'gulp';
import rollup from 'rollup-stream';
import source from 'vinyl-source-stream';
import ngc from 'gulp-ngc';
import rollupConfig from './rollup-config';
gulp.task('ngc', () => {
return ngc('tsconfig.json');
});
gulp.task('rollup', ['ngc'], () => {
return rollup(rollupConfig)
.pipe(source('index.js'))
.pipe(gulp.dest('./dist'));
});