Skip to content

Commit

Permalink
switch watch to use glob-watcher wrapper around chokidar
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Apr 28, 2016
1 parent 37dffae commit 6c03475
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

7 comments on commit 6c03475

@zckrs
Copy link
Contributor

@zckrs zckrs commented on 6c03475 Apr 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@alexandru-calinoiu
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately now because of this change when watching file changes on stylus files, if there is a issue on linting gulp will error out and we need to restart the task.

It used to rerun the lint show the warnings and continue watching for changes.

@phated
Copy link
Member Author

@phated phated commented on 6c03475 Apr 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexandru-calinoiu commenting inline doesn't help me at all. I can't tell if you've written your task poorly or something in glob-watcher. Please open an issue with your task and other information.

@grosewarne
Copy link

@grosewarne grosewarne commented on 6c03475 Apr 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this update foundation framework stop working after first change on html files. :(
Stop working after first change

@callumacrae
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grosewarne: As above, open an issue

@nmccready
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done #1658

@phated
Copy link
Member Author

@phated phated commented on 6c03475 May 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been submitted as #1623, #1624, #1626, #1638, #1656 AND #1658 - stop submitting it at fix your gulpfiles.

Please sign in to comment.