You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Django project with a large number of files in the working directory, so if I run vite dev the file watcher takes a lot of CPU and soon runs out of file handles. To avoid this I would like to specify particular paths for Vite to watch.
Two previous requests for this feature were closed because a workaround exists (here and here). But I can't figure out what the workaround is (and in one case I don't think they found one, just used a manual blocklist).
My initial thought from the watch.ignored documentation was that something like this in npm create vite@latest vite-base -- --template vue should work to restrict the watcher to the src directory:
But when I run this in the vanilla vue template, changes to all files are ignored. I tried some variations like including absolute paths (see reproduction link) and couldn't get those to work either.
Can others reproduce this problem, or am I messing something up? If this workaround doesn't work, maybe it's worth revisiting the option to override paths passed to chokidar.watch.
(In the meantime I think my workaround is to list the directory in js and provide everything to ignored except the desired paths. Messy, but better than having to manually maintain a list of Django files or rearrange Django's directory structure.)
((Eagerly awaiting the obvious thing I've missed. 😆))
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
Describe the bug
I have a Django project with a large number of files in the working directory, so if I run
vite dev
the file watcher takes a lot of CPU and soon runs out of file handles. To avoid this I would like to specify particular paths for Vite to watch.Two previous requests for this feature were closed because a workaround exists (here and here). But I can't figure out what the workaround is (and in one case I don't think they found one, just used a manual blocklist).
My initial thought from the
watch.ignored
documentation was that something like this innpm create vite@latest vite-base -- --template vue
should work to restrict the watcher to thesrc
directory:But when I run this in the vanilla vue template, changes to all files are ignored. I tried some variations like including absolute paths (see reproduction link) and couldn't get those to work either.
Can others reproduce this problem, or am I messing something up? If this workaround doesn't work, maybe it's worth revisiting the option to override paths passed to
chokidar.watch
.(In the meantime I think my workaround is to list the directory in js and provide everything to
ignored
except the desired paths. Messy, but better than having to manually maintain a list of Django files or rearrange Django's directory structure.)((Eagerly awaiting the obvious thing I've missed. 😆))
Reproduction
https://stackblitz.com/edit/vitejs-vite-voaybn?file=vite.config.js
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: