Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument glob array does not work correctly #237

Open
caikan opened this issue Jun 14, 2016 · 1 comment
Open

Argument glob array does not work correctly #237

caikan opened this issue Jun 14, 2016 · 1 comment

Comments

@caikan
Copy link

caikan commented Jun 14, 2016

Some patterns will not work, when there is a "not match" pattern before them.
OS:Windows 7.

// The 3rd pattern in this example doesn't work. 
watch(['src/**', '!src/**/*.js', 'src/**/*.min.js'], function (vinyl) {
    console.log('[watcher]', vinyl.relative);
});
// This still doesn't work
var watcher = watch(['src/**', '!src/**/*.js'], function (vinyl) {
    console.log('[watcher 1]', vinyl.relative);
});
watcher.add('src/**/*.min.js');
// I use this way to around this bug.
watch(['src/**', '!src/**/*.js'], function (vinyl) {
    console.log('[watcher 1]', vinyl.relative);
});
watch(['src/**/*.min.js'], function (vinyl) {
    console.log('[watcher 2]', vinyl.relative);
});
@UltCombo
Copy link
Collaborator

Let me make sure I understand correctly: you want negative globs to be processed in the order they appear in the patterns array, similarly to what I have implemented in gulp's glob-stream? (gulpjs/glob-stream#25 / gulpjs/glob-stream#27)

I believe it may be the case that gulp-watch's underlying file system watcher—Chokidar—always executes negative globs last, so that's why your sample fails. Please file a feature request in the Chokidar repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants