-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
33 lines (27 loc) · 997 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"use strict";
var gulp = require('gulp');
var tsc = require('gulp-typescript');
var tsProject = tsc.createProject('tsconfig.json', { noImplicitAny: false });
var config = require('./gulpConfig');
var merge = require('merge2');
var del = require('del');
//We should delete the dist folder everytime before building
gulp.task('compile-all', function () {
var sourceTsFiles = [config.allts,
config.allTypings
];
var tsResult = gulp.src(sourceTsFiles)
.pipe(tsProject());
return merge([ // Merge the two output streams, so this task is finished when the IO of both operations is done.
tsResult.dts.pipe(gulp.dest(config.outputFolder)),
tsResult.js.pipe(gulp.dest(config.outputFolder))
]);
});
gulp.task('watch', ['compile-all'], function () {
gulp.watch(config.allts, ['compile-all']);
});
gulp.task('clean', function () {
return del(['dist']);
});
gulp.task('clean-build', ['clean', 'compile-all']);
gulp.task('default', ['clean-build']);