vite changes

pull/251/head
ndcroos 7 months ago
parent 911ef00f45
commit 395b8b19a1

@ -3,6 +3,9 @@ import react from '@vitejs/plugin-react-swc'
import { viteStaticCopy } from 'vite-plugin-static-copy' import { viteStaticCopy } from 'vite-plugin-static-copy'
import svgr from "vite-plugin-svgr" import svgr from "vite-plugin-svgr"
const backendPort = process.env.PORT || 8080;
const clientPort = process.env.CLIENT_PORT || 3000;
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
//root: 'client/src', //root: 'client/src',
@ -32,20 +35,20 @@ export default defineConfig({
exclude: ['games'] exclude: ['games']
}, },
server: { server: {
port: 3000, port: Number(clientPort),
proxy: { proxy: {
'/websocket': { '/websocket': {
target: 'ws://localhost:8080', target: `ws://localhost:${backendPort}`,
ws: true ws: true
}, },
'/import': { '/import': {
target: 'http://localhost:8080', target: `ws://localhost:${backendPort}`,
}, },
'/data': { '/data': {
target: 'http://localhost:8080', target: `ws://localhost:${backendPort}`,
}, },
'/i18n': { '/i18n': {
target: 'http://localhost:8080', target: `ws://localhost:${backendPort}`,
}, },
} }
}, },

Loading…
Cancel
Save