Tuesday, January 12, 2016

First gulp is the best gulp

var gulp = require('gulp');
var ts = require('gulp-typescript');

var tsProject = ts.createProject('theApp/tsconfig.json');


gulp.task('typings', function () {
    return gulp.src('theApp/**/*.d.ts')
        .pipe(gulp.dest('./xdeploy'));
});



gulp.task('genjs', ['typings'], function () {
    return tsProject.src('theApp/**/*.ts')
        .pipe(ts(tsProject))
        .pipe(gulp.dest('./xdeploy'));
});

gulp.task('copyjs',  ['genjs'], function () {
    return gulp.src('theApp/**/*.js')
        .pipe(gulp.dest('./xdeploy'));
});

gulp.task('copyjson',  ['copyjs'], function () {
    return gulp.src('theApp/**/*.json')
        .pipe(gulp.dest('./xdeploy'));
});



gulp.task('default', ['copyjson'], function () {
    return gulp.src('theApp/node_modules/**/*', { 'base' : 'theApp/node_modules' })
        .pipe(gulp.dest('./xdeploy/node_modules'));
});