-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
36 lines (30 loc) · 1.04 KB
/
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
34
35
36
"use strict";
var gulp = require('gulp');
var tsc = require('gulp-typescript');
var sourcemaps = require('gulp-sourcemaps');
var tsProject = tsc.createProject('tsconfig.json');
var config = require('./gulpConfig');
gulp.task('compile-all', function () {
var sourceTsFiles = [config.allts,
config.allTypings];
var tsResult = gulp.src(sourceTsFiles)
.pipe(sourcemaps.init())
.pipe(tsc(tsProject));
tsResult.dts.pipe(gulp.dest(config.outputFolder));
return tsResult.js
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(config.outputFolder));
});
gulp.task('compile-test', function () {
var sourceTsFiles = [config.allTests, config.allTypings];
var tsResult = gulp.src(sourceTsFiles)
.pipe(sourcemaps.init())
.pipe(tsc(tsProject));
tsResult.dts.pipe(gulp.dest(config.outputFolder));
return tsResult.js
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(config.outputFolder));
});
gulp.task('default', function () {
gulp.watch('src/**/*.ts', ['compile-all'])
});