-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Dev server crawling dynamic imports on MacOS #9391
Comments
The main problem seems to be here: vite/packages/vite/src/node/plugins/importMetaGlob.ts Lines 63 to 66 in 875fc11
For each of those files, its directory name is passed to the dev server's watcher (Chokidar in macOS). This itself is redundant because the directory name is the same for all files in this case. Chokidar allows watching the same path, so this block of code effectively adds 2000 duplicate watchers for Compounding the problem, Chokidar scans the directory's entries for each call to But the watchers in |
@tony19 Could you please create a PR for it if you already got a working fix? Thanks for looking into it! |
Describe the bug
I am using
import.meta.glob
and for many files, it takes a considerable time for the first reply from the dev server (with 1000 files about 25s on my system). This is only happening on MacOS, on Linux the delay is not there and the Site debug logging also states that there is nothing to crawl.Reproduction
https://stackblitz.com/edit/vitejs-vite-wsr2nk?file=main.js
System Info
Used Package Manager
npm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: