File: Gulpfile.js

Recommend this page to a friend!
  Classes of Jakub Krol  >  collab-ms  >  Gulpfile.js  >  Download  
File: Gulpfile.js
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: collab-ms
Manage the creation of worker processes
Author: By
Last change: Source code & build here! :)
Date: 1 month ago
Size: 654 bytes
 

Contents

Class file image Download
var gulp = require('gulp');
var ts = require('gulp-typescript');
var merge = require('merge2');

var tsProject = ts.createProject({
    declaration: true,
    noExternalResolve: true,
    module:'commonjs',
    target: 'es6',
});

gulp.task('scripts', function() {
    var tsResult = gulp.src('src/**/*.ts')
        .pipe(ts(tsProject));

    return merge([ // Merge the two output streams, so this task is finished when the IO of both operations are done.
        tsResult.dts.pipe(gulp.dest('build')),
        tsResult.js.pipe(gulp.dest('build'))
    ]);
});

gulp.task('watch', ['scripts'], function() {
    gulp.watch('src/**/*.ts', ['scripts']);
});