fix: pre-scan app files so Vite does not reload the page mid-action

This commit is contained in:
rajun 2026-10-27 16:28:46 +05:30
parent 4e3cdbac11
commit de5ac76637

View File

@ -9,4 +9,10 @@ export default defineConfig({
port: 5173,
host: true, // allow external access (local dev only)
},
optimizeDeps: {
// Dev only: scan every app file for libraries at startup. The route list React Router passes matches nothing
// here, so libraries were found late, and Vite reloaded the open page mid-action (e.g. after creating a project),
// which could leave it stuck on the loading screen.
entries: ['app/**/*.{ts,tsx}', '!app/**/*.d.ts', '!app/routes.ts'],
},
});