fix(vite): exclude api/ folder from Vite module processing and watcher
This commit is contained in:
+9
-1
@@ -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'],
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user