-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathgulpfile.js
More file actions
27 lines (22 loc) · 797 Bytes
/
gulpfile.js
File metadata and controls
27 lines (22 loc) · 797 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
const del = require("del");
const path = require("path");
const gulp = require("gulp");
const emu = require("gulp-emu");
const gls = require("gulp-live-server");
gulp.task("clean", () => del("docs/**/*"));
gulp.task("build", () => gulp
.src(["spec/index.html"])
.pipe(emu())
.pipe(gulp.dest("docs")));
gulp.task("watch", () => gulp
.watch(["spec/**/*"], gulp.task("build")));
gulp.task("start", gulp.parallel("watch", () => {
const server = gls.static("docs", 8080);
const promise = server.start();
(/** @type {import("chokidar").FSWatcher}*/(gulp.watch(["docs/**/*"])))
.on("change", file => {
server.notify({ path: path.resolve(file) });
});
return promise;
}));
gulp.task("default", gulp.task("build"));