From de5ac766374a3a9c6da51fdb68381c52345403be Mon Sep 17 00:00:00 2001 From: rajun Date: Tue, 27 Oct 2026 16:28:46 +0530 Subject: [PATCH] fix: pre-scan app files so Vite does not reload the page mid-action --- vite.config.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vite.config.ts b/vite.config.ts index 6fa6aab..dad278f 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -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'], + }, });