22 lines
425 B
JavaScript
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/, '')
|
|
}
|
|
}
|
|
}
|
|
});
|