guard / listen

The Listen gem listens to file modifications and notifies you about the changes.
https://rubygems.org/gems/listen
MIT License
1.92k stars 246 forks source link

Ignore Directories from Polling #437

Closed stevenmccord closed 3 years ago

stevenmccord commented 6 years ago

I am sure I am missing something, but is there a way to set it up that when we ignore a directory that polling doesn't actually setup looking at it. I think that it should be ignored, but I don't know exactly if I am setting something up wrong.

For example, say I wanted to ignore node_modules from the listening for all directories recursively, is there an example that shows that. Or is this not possible? Thanks!

stevenmccord commented 6 years ago

Just to provide a bit more information here, this is what I am trying to do.

Set up one directory to watch like so /code/

Inside of that directory I would have something like this

/code/project1/src/
/code/project1/node_modules/
/code/project2/src/
/code/project2/node_modules/

I want to ignore those node_modules directories from polling altogether. When I turn on polling it appears they are still adding those initially and b/c of that it takes longer to recognize the changes. It does appear that it is ignoring any file modifications to the node_modules, but it appears that it is still including that in the polling.

I read up on this ticket, and it appears that it should work in this manner, but maybe I am not fully understanding everything. https://github.com/guard/listen/issues/274.

Thanks!

ColinDKelley commented 3 years ago

We merged in a recent optimization to not watch ignored directories. I'm hoping that addressed this issue. So I'm closing this one.