-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathgulpfile.js
More file actions
29 lines (24 loc) · 799 Bytes
/
gulpfile.js
File metadata and controls
29 lines (24 loc) · 799 Bytes
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
const gulp = require('gulp');
const ts = require('gulp-typescript');
const mocha = require('gulp-mocha');
// pull in the project Typescript config
const tsProject = ts.createProject('tsconfig.json');
//task to be run when the watcher detects changes
gulp.task('scripts', () => {
const tsResult = tsProject.src()
.pipe(tsProject());
return tsResult.js.pipe(gulp.dest('.'))
.pipe(mocha({reporter: "min"}));
});
gulp.task('build', () => {
const tsResult = tsProject.src()
.pipe(tsProject());
return tsResult.js.pipe(gulp.dest('.'))
.pipe(mocha({reporter: "list"}));
});
//set up a watcher to watch over changes
gulp.task('watch', gulp.series('scripts', function(){
gulp.watch('**/*.ts', gulp.series('scripts'));
}));
gulp.task('default', gulp.series('watch', function(){
}));