forked from santee/santee-dcts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
42 lines (36 loc) · 1.01 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
var gulp = require('gulp');
var mocha = require('gulp-mocha');
var ts = require('gulp-typescript');
var tslint = require("gulp-tslint");
var merge = require('merge2');
var del = require('del');
gulp.task('clean', function() {
return del([
'src/**/*.js',
'src/**/*.d.ts',
'tests/**/*.js',
'tests/**/*.d.ts',
]);
})
gulp.task('test', function() {
return gulp.src('tests/**/*.js', {read: false})
.pipe(mocha());
});
var tsProject = ts.createProject('./tsconfig.json');
gulp.task('typescript', ['tslint'], function () {
var tsResult = tsProject
.src()
.pipe(ts(tsProject));
return [
tsResult.js.pipe(gulp.dest('.')),
tsResult.dts.pipe(gulp.dest('.'))
];
});
gulp.task('tslint', ['clean'], function() {
return gulp.src(["src/**.ts", "tests/**.ts", "index.ts"])
.pipe(tslint())
.pipe(tslint.report("verbose"))
});
gulp.task('watch', ['typescript'], function() {
return gulp.watch('**/*.ts', ['typescript']);
});