-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgulpfile.js
33 lines (29 loc) · 896 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
var gulp = require("gulp");
var exec = require('child_process').exec;
var ts = require("gulp-typescript");
const tsProject = ts.createProject("./src/tsconfig.json");
gulp.task("build", function() {
return tsProject
.src(["./src/*.ts", "./typings/index.d.ts"])
.pipe(ts(tsProject))
.js.pipe(gulp.dest("./src"));
});
gulp.task("build-tests", function() {
return tsProject
.src(["./tests/test.ts", "./typings/index.d.ts"])
.pipe(ts(tsProject))
.js.pipe(gulp.dest("./tests"));
});
gulp.task("run-tests", function(cb) {
exec('node ./tests/test', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
});
gulp.task("default", ["build"]);
gulp.task("tests", ["build-tests", "run-tests"]);
//gulp.task('watch', function () {
// gulp.watch('src/**/*.ts', ['build']);
// gulp.watch('tests/**/*.ts', ['buildTests']);
//});