-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulp.dev.js
More file actions
31 lines (29 loc) · 709 Bytes
/
gulp.dev.js
File metadata and controls
31 lines (29 loc) · 709 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
30
31
var ts = require("gulp-typescript");
var tsProject = ts.createProject("tsconfig.json");
const { series, task, dest, watch } = require("gulp");
const spawn = require("child_process").spawn;
let spawnedNode = null;
task("all", function () {
if (!spawnedNode)
spawnedNode = spawn("nodemon", ["./examples/node.js"], {
stdio: "inherit",
stderr: "inherit",
stdout: "inherit",
});
return tsProject
.src()
.pipe(tsProject())
.js.pipe(dest("dist"))
.on("end", (error) => {
console.log("error", error);
});
});
task("watch", function () {
watch("src/*.ts", series("all"));
});
task(
"default",
series("all", "watch", function (done) {
done();
})
);