From 0c660697b8376c0185bb9e65aca0c01107b7433e Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Wed, 27 Apr 2016 20:02:30 -0700 Subject: [PATCH] Breaking: Replace chokidar as gulp.watch with glob-watcher wrapper --- index.js | 16 ++-------------- package.json | 2 +- 2 files changed, 3 insertions(+), 15 deletions(-) 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 af155392e..a23a0dd88 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"