Skip to content

Commit

Permalink
Breaking: Replace chokidar as gulp.watch with glob-watcher wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Dec 31, 2017
1 parent c3dbc10 commit 0c66069
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
16 changes: 2 additions & 14 deletions index.js
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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"
Expand Down

0 comments on commit 0c66069

Please sign in to comment.