diff --git a/index.js b/index.js index 2058ce0b6..cddf7eb6f 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ var util = require('util'); var Undertaker = require('undertaker'); var vfs = require('vinyl-fs'); -var chokidar = require('chokidar'); +var watch = require('glob-watcher'); function Gulp() { Undertaker.call(this); @@ -42,19 +42,7 @@ Gulp.prototype.watch = function(glob, opt, task) { fn = this.parallel(task); } - if (opt.ignoreInitial == null) { - opt.ignoreInitial = true; - } - - var watcher = chokidar.watch(glob, opt); - if (fn) { - watcher - .on('change', fn) - .on('unlink', fn) - .on('add', fn); - } - - return watcher; + return watch(glob, opt, fn); }; // Let people use this class from our instance diff --git a/package.json b/package.json index 47fdc6912..042dc2ca7 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ }, "man": "gulp.1", "dependencies": { - "chokidar": "^1.2.0", + "glob-watcher": "^3.0.0", "gulp-cli": "^1.0.0", "undertaker": "^0.15.0", "vinyl-fs": "^2.0.0"