Skip to content
This repository has been archived by the owner on Sep 8, 2021. It is now read-only.

Commit

Permalink
Fix live reload in gulpfile
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuckton committed Jan 15, 2021
1 parent 798b817 commit 98ff9af
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gulpfile.js
@@ -1,8 +1,8 @@
const del = require("del");
const path = require("path");
const gulp = require("gulp");
const emu = require("gulp-emu");
const gls = require("gulp-live-server");
const spawn = require("child_process").spawn;

const clean = () => del("docs/**/*");
gulp.task("clean", clean);
Expand All @@ -20,7 +20,10 @@ gulp.task("watch", watch);
const serve = () => {
const server = gls.static("docs", 8080);
const promise = server.start();
gulp.watch(["docs/**/*"], file => server.notify(file));
(/** @type {import("chokidar").FSWatcher}*/(gulp.watch(["docs/**/*"])))
.on("change", file => {
server.notify({ path: path.resolve(file) });
});
return promise;
};
gulp.task("start", gulp.parallel(watch, serve));
Expand Down

0 comments on commit 98ff9af

Please sign in to comment.