From 18514d63534c82094b231eb1e0b0e41011519183 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Mon, 21 Oct 2013 16:37:52 -0700 Subject: [PATCH] feat(config): add usePolling config This config option is forwarded to chokidar. When set to `true` (default value is `false`), chokidar uses `fs.watch` instead of stat polling. This seems to be finally working well on linux, however it does not work on Mac. See https://github.com/paulmillr/chokidar/issues/62 That's why I'm leaving it undocumented ;-) --- lib/config.js | 1 + lib/watcher.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/config.js b/lib/config.js index 2be5b5903..3f08214b6 100644 --- a/lib/config.js +++ b/lib/config.js @@ -263,6 +263,7 @@ var Config = function() { this.colors = true; this.autoWatch = false; this.autoWatchBatchDelay = 250; + this.usePolling = false; this.reporters = ['progress']; this.singleRun = false; this.browsers = []; diff --git a/lib/watcher.js b/lib/watcher.js index ee113fd37..ce76e3758 100644 --- a/lib/watcher.js +++ b/lib/watcher.js @@ -71,9 +71,10 @@ var getWatchedPatterns = function(patternObjects) { }); }; -exports.watch = function(patterns, excludes, fileList) { +exports.watch = function(patterns, excludes, fileList, usePolling) { var watchedPatterns = getWatchedPatterns(patterns); var options = { + usePolling: usePolling, ignorePermissionErrors: true, ignoreInitial: true, ignored: createIgnore(watchedPatterns, excludes) @@ -96,4 +97,4 @@ exports.watch = function(patterns, excludes, fileList) { return chokidarWatcher; }; -exports.watch.$inject = ['config.files', 'config.exclude', 'fileList']; +exports.watch.$inject = ['config.files', 'config.exclude', 'fileList', 'config.usePolling'];