Co-authored-by: Stephan Charles <[email protected]> Co-authored-by: Amelia Hernandez <[email protected]> Co-authored-by: Markus Franz <[email protected]> Co-authored-by: Sabrina Hota <[email protected]> Co-authored-by: Nilüfer Doğan <[email protected]>
21 lines
683 B
TypeScript
21 lines
683 B
TypeScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
|
|
// Dev server proxies /auth, /rest, /realtime, /storage to the local Supabase
|
|
// stack so the app can use relative URLs (works in Docker + localhost).
|
|
const SUPABASE_TARGET = 'http://127.0.0.1:54321';
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
server: {
|
|
host: true,
|
|
port: 3000,
|
|
proxy: {
|
|
'/auth/v1': { target: SUPABASE_TARGET, changeOrigin: true },
|
|
'/rest': { target: SUPABASE_TARGET, changeOrigin: true },
|
|
'/realtime': { target: SUPABASE_TARGET, changeOrigin: true, ws: true },
|
|
'/storage': { target: SUPABASE_TARGET, changeOrigin: true },
|
|
},
|
|
},
|
|
});
|