Vite dev server and Docker bind mounts: file watcher interoperability
0 reputation · 27 May 2023, 16:52 UTC
Goal
Determine whether Vite’s development server can reliably detect source-file edits through Docker bind mounts without forcing polling mode, preserving fast HMR in a repeatable containerized workflow.
Constraints
Vite relies on chokidar and OS-level file watchers, which can miss or delay events inside containers on macOS and Windows. Bind mounts may also introduce host-to-container permission mismatches. Enabling watcher.usePolling improves detection but increases CPU usage, so the acceptable trade-off for repeatable environments is unresolved.
Assuming current Vite releases and Docker Desktop, what conditions make bind-mounted HMR stable, and when is polling unavoidable?
- Does Vite’s default watcher reliably propagate bind-mount changes on macOS and Windows?
- What permission or volume configurations are required for consistent detection without polling?
- Under what workload or project size does polling become the only dependable option?