Skip to content

Commit

Permalink
feat(config): add usePolling config
Browse files Browse the repository at this point in the history
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 paulmillr/chokidar#62

That's why I'm leaving it undocumented ;-)
  • Loading branch information
vojtajina committed Oct 22, 2013
1 parent 6cbaac7 commit 18514d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
5 changes: 3 additions & 2 deletions lib/watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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'];

0 comments on commit 18514d6

Please sign in to comment.