From f9f25cf797dc1b506cb53abfc85da2f3c332cc3b Mon Sep 17 00:00:00 2001 From: Satyam-Rastogi Date: Tue, 19 May 2026 02:55:33 +0530 Subject: [PATCH] fix(vite): exclude api/ folder from Vite module processing and watcher --- vite.config.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/vite.config.js b/vite.config.js index 8b0f57b..1820849 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,7 +1,15 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' -// https://vite.dev/config/ export default defineConfig({ plugins: [react()], + server: { + // Don't watch or serve /api — those are Vercel serverless functions, not frontend code + watch: { ignored: ['**/api/**'] }, + fs: { deny: ['api'] }, + }, + optimizeDeps: { + // Don't pre-bundle serverless function files + exclude: ['api'], + }, })