Messenger/packages/web/vite.config.ts
Заид Омар Медхат | Zaid Omar Medhat f653b083aa f
2026-07-13 12:32:00 +05:00

26 lines
862 B
TypeScript

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
// Proxy API + realtime through the dev server so the browser talks to a single
// origin (localhost:5173). This lets the httpOnly refresh cookie work over http
// with SameSite=Lax instead of requiring cross-origin SameSite=None; Secure.
export default defineConfig({
plugins: [react()],
optimizeDeps: {
// ffmpeg.wasm spawns its worker from its own module URL; Vite's dep
// pre-bundling breaks that resolution in dev — load it unbundled.
exclude: ['@ffmpeg/ffmpeg', '@ffmpeg/util'],
},
server: {
host: true,
port: 5173,
proxy: {
'/api': { target: 'http://localhost:8080', changeOrigin: true },
'/connection/websocket': {
target: 'http://localhost:8080',
changeOrigin: true,
ws: true,
},
},
},
});