0.3.3 • Published 7 years ago

gulp-ngc v0.3.3

Weekly downloads
389
License
MIT
Repository
github
Last release
7 years ago

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