From 298eb4dff25b4e97b66d49f005c896a88b0df5c6 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sat, 3 Apr 2021 03:48:44 +0700 Subject: all: exclude common file and directories names for being watched By default, any hidden files on Unix like system, which start with dot '.' should not be watched for any changes. So does "node_modules" from npm and "vendor" directory which may contains many unrelated files. --- watcher.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/watcher.go b/watcher.go index ed70dc3..6a8b98d 100644 --- a/watcher.go +++ b/watcher.go @@ -56,6 +56,11 @@ func newWatcher(htmlg *htmlGenerator, dir string) (w *watcher, err error) { Includes: []string{ `.*\.adoc$`, }, + Excludes: []string{ + `^\..*`, + `node_modules/.*`, + `vendor/.*`, + }, }, Delay: time.Second, Callback: w.onChangeFileMarkup, -- cgit v1.3