Exclude folders from FileWatchService #11853
Unanswered
TedisAgolli
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I am wondering if there is a way to exclude a specific folder from being watched by FileWatchService
My setup specifically has a
react
folder underapp/assets
. Changes being made there are compiled by webpack. But those changes also cause my Play App to recompile, which takes longer.react
folder out ofapp
but it requires changing a lot of other things, which I would rather not do.watch
method by dynamically modifyingfilesToWatch
.filesToWatch
by default contains['app']
. I have tried modifying it to include every other folder insideapp
that is notreact
So it would end up looking like this
['app/controllers', 'app/forms', 'app/jobs'....]
etcThis isn't too bad but I'm wondering if creating a watcher for each of these folders is more expensive than just watching the top level folder.
What I would ideally like to do is be able to pass something to an
exclude
method that just ignores folders which contain a certain string in their path.Thank you in advance, and hope my explanation was clear.
Beta Was this translation helpful? Give feedback.
All reactions