41 lines
916 B
JavaScript
41 lines
916 B
JavaScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
const wsUrl = process.env.CUSTOM_VITE_WS_URL || 'wss://excalidraw.forkless.com';
|
|
|
|
export default defineConfig({
|
|
root: 'frontend',
|
|
plugins: [react()],
|
|
define: {
|
|
'import.meta.env.CUSTOM_VITE_WS_URL': JSON.stringify(wsUrl),
|
|
},
|
|
build: {
|
|
outDir: '../dist/frontend',
|
|
emptyOutDir: true,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
if (
|
|
id.includes('@excalidraw/excalidraw') &&
|
|
id.includes('subset')
|
|
) {
|
|
return id.split('/').pop()?.replace(/\.[^.]+$/, '');
|
|
}
|
|
},
|
|
},
|
|
},
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:3000',
|
|
changeOrigin: true,
|
|
},
|
|
'/health': {
|
|
target: 'http://localhost:3000',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
})
|