silphius/vite.config.js
2024-05-26 12:05:59 -05:00

22 lines
425 B
JavaScript

import {defineConfig} from 'vite'
import react from '@vitejs/plugin-react'
const {
SILPHIUS_WEBSOCKET_PORT = 8080
} = process.env;
export default defineConfig({
plugins: [react()],
server: {
host: true,
proxy: {
'^/ws$': {
target: `ws://127.0.0.1:${SILPHIUS_WEBSOCKET_PORT}`,
ws: true,
changeOrigin: true,
rewrite: path => path.replace(/^\/ws/, '')
}
}
}
});