From 24a4b84717f1a5b37c0399b0ec8a3b174c30a021 Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Mon, 4 Dec 2017 20:05:58 +0000 Subject: [PATCH] feat: disable chokidar globbing on windows (#1140) Fixes a range of issues, including: Fixes #1115 * refactor: use Object.assign in place of merge (this will leak to more work) Since we're now supporting 6 upwards --- lib/config/defaults.js | 2 ++ lib/monitor/watch.js | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/config/defaults.js b/lib/config/defaults.js index 83a0ea30..622c71b5 100644 --- a/lib/config/defaults.js +++ b/lib/config/defaults.js @@ -20,5 +20,7 @@ module.exports = { // but also includes stderr. If this is false, data is still dispatched via // nodemon.on('stdout/stderr') stdout: true, + watchOptions: { + }, }; diff --git a/lib/monitor/watch.js b/lib/monitor/watch.js index 968de215..1a8f0918 100644 --- a/lib/monitor/watch.js +++ b/lib/monitor/watch.js @@ -56,11 +56,17 @@ function watch() { interval: config.options.pollingInterval, }; + if (utils.isWindows) { + watchOptions.disableGlobbing = true; + } + if (process.env.TEST) { watchOptions.useFsEvents = false; } - var watcher = chokidar.watch(dir, watchOptions); + var watcher = chokidar.watch(dir, + Object.assign({}, watchOptions, config.watchOptions || {}) + ); watcher.ready = false;