From 5a516b221a1a7b4678338b48ec7ecb97e027ccea Mon Sep 17 00:00:00 2001 From: Kevin Van Lierde Date: Wed, 28 Jun 2023 00:18:54 +0200 Subject: [PATCH] Sets chokidar watchOption awaitWriteFinish to false, and batch timer to 0 to speed up watching --- lib/index.js | 2 +- lib/watcher.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 6916b21..cadad90 100644 --- a/lib/index.js +++ b/lib/index.js @@ -525,7 +525,7 @@ Metalsmith.prototype.watch = function (options) { cwd: this.directory(), ignored: this.ignore(), ignoreInitial: true, - awaitWriteFinish: true + awaitWriteFinish: false } } return this diff --git a/lib/watcher.js b/lib/watcher.js index 24b2492..b123a57 100644 --- a/lib/watcher.js +++ b/lib/watcher.js @@ -135,7 +135,7 @@ module.exports = function watchable(files, metalsmith) { (err) => onRebuild(err) ) }) - }, 1000) + }, 0) }) return new Promise((resolve, reject) => { rerun()