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

How to filter files to watch? #137

Closed
artem-malko opened this issue Feb 15, 2015 · 9 comments
Closed

How to filter files to watch? #137

artem-malko opened this issue Feb 15, 2015 · 9 comments

Comments

@artem-malko
Copy link

No description provided.

@artem-malko artem-malko changed the title How to unwatch files? How to filter files to watch? Feb 15, 2015
@artem-malko
Copy link
Author

For example i've got a folder with css-files and i'd like to watch for them. But i'd like to not watch for one css-file.
So:

watch('./folder-to-watch/**/*.css', function(vinyl) {
    log(vinyl.event);
});

Where (or how) should i add the path to ignored file?

@floatdrop
Copy link
Owner

As node-glob docs says:

watch(['!folder-to-watch/that-one.css','folder-to-watch/**/*.css'], function(vinyl) {
    log(vinyl.event);
});

@artem-malko
Copy link
Author

Yeah, thanks. It doesn't work, if i use './' in glob pattern(
https://github.com/isaacs/node-glob#dots I think, that dot:true could fix it, doesn't it? How can i set option of glob «dot» to true?

@floatdrop
Copy link
Owner

@artem-malko it is known bug with ./ in globs - #1, so don't use ./, just type path without it.

@artem-malko
Copy link
Author

Ok, but could it helps, to set dot to true?

@floatdrop
Copy link
Owner

@artem-malko I don't think chokidar uses node-glob for path's actually, so there is no dot option unfortunately.

@artem-malko
Copy link
Author

Excuse me, but one more question)

What the difference between 'folder-name/.css' and './folder-name/.css' if we have a fs like this:

├── gulpfile.js
└── folder-name

@floatdrop
Copy link
Owner

@artem-malko I'm not aware of any difference between folder-name/.css and ./folder-name/.css in this case.

@artem-malko
Copy link
Author

Ok, thanks a lot)

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

No branches or pull requests

2 participants