-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
43 lines (36 loc) · 1 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
37
38
39
40
41
42
43
var gulp = require('gulp');
var ts = require('gulp-typescript');
var sourcemaps = require('gulp-sourcemaps');
var merge = require('merge2');
var mocha = require('gulp-spawn-mocha');
var tsProject = ts.createProject('tsconfig.json');
gulp.task('default', function () {
var tsResult = tsProject.src('tsconfig.json')
.pipe(sourcemaps.init())
.pipe(ts(tsProject));
return merge([
tsResult.dts.pipe(gulp.dest('dist')),
tsResult.js
.pipe(sourcemaps.write('.', {
includeContent: false,
sourceRoot: '../src'
}))
.pipe(gulp.dest('dist'))
]);
});
gulp.task('test', function() {
return gulp
.src(['test/*.js'])
.pipe(mocha({
growl: true,
// reporter: "min",
istanbul: false,
require: 'source-map-support/register'
}));
});
gulp.task('watch', ['default'], function () {
gulp.watch(['src/**/*.ts'], ['default']);
});
gulp.task('tdd', ['default', 'test'], function () {
gulp.watch(['src/**/*.ts', 'test/*.js'], ['default', 'test']);
});