20 lines
547 B
JavaScript
20 lines
547 B
JavaScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
// In dev, proxy the API + uploads to the Express server so the SPA stays
|
|
// same-origin (cookies work) and matches the production setup where Express
|
|
// serves the built client.
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
'/api': { target: 'http://localhost:3000', changeOrigin: true },
|
|
'/uploads': { target: 'http://localhost:3000', changeOrigin: true },
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
},
|
|
})
|