gulp-ngc

v0.2.0
Extremely simple and dummy gulp plugin who wraps @angular/compiler-cli
gulp ngc angular2 compiler cli compiler-cli

gulp-ngc

Extremely simple and dummy gulp plugin who wraps @angular/compiler-cli

Angular 5

Angular 5 has brought breaking changes for this plugin, that is why currently it isn't compatible with this version of Angular

Usage

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'));
});

Using NGC options:


gulp.task('ngc', () => {
    return ngc('tsconfig.json', {
         i18nFile: './src/locale/messages.fr.xlf',
         locale: 'fr',
         i18nFormat: 'xlf',
    });
});

Metadata

  • MIT
  • >=4.7.0
  • Igor Onyshchenko
  • released 2/17/2017

Downloads

Maintainers