fix: ignore temp files in Vite watcher to prevent dev server crash (#3763)
## Summary - Adds default `server.watch.ignored` patterns to the Fresh Vite plugin config - Ignores `*.tmp.*`, `*.timestamp-*`, editor swap files (`*.swp`, `*.swo`, `*~`, `.#*`) - Prevents a `watchFs` race condition on Linux where Deno tries to open a short-lived file that was already deleted, crashing the dev server with `NotFound: No such file or directory` Users can still override or extend these patterns in their own `vite.config.ts` since Vite merges config from plugins. Closes #3585 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
b3cb5b5e31
commit
f39a198f8d
@@ -91,6 +91,23 @@ export function fresh(config?: FreshViteConfig): Plugin[] {
|
||||
isDev = env.command === "serve";
|
||||
|
||||
return {
|
||||
server: {
|
||||
watch: {
|
||||
// Ignore temp files, editor swap files, and Vite timestamp
|
||||
// files. On Linux, these short-lived files can trigger a
|
||||
// watchFs race condition in Deno where the watcher tries to
|
||||
// open a file that has already been deleted, crashing the
|
||||
// dev server with ENOENT.
|
||||
ignored: [
|
||||
"**/*.tmp.*",
|
||||
"**/*.timestamp-*",
|
||||
"**/*~",
|
||||
"**/.#*",
|
||||
"**/*.swp",
|
||||
"**/*.swo",
|
||||
],
|
||||
},
|
||||
},
|
||||
esbuild: {
|
||||
jsx: "automatic",
|
||||
jsxImportSource: "preact",
|
||||
|
||||
Reference in New Issue
Block a user