34 lines
938 B
TypeScript
34 lines
938 B
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react-swc";
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
base: "/lst/app/",
|
|
build: {
|
|
//outDir: "../backend/frontend",
|
|
//assetsDir: "assets",
|
|
emptyOutDir: true,
|
|
},
|
|
server: {
|
|
proxy: {
|
|
"/lst/api": {
|
|
target: `http://localhost:${Number(
|
|
process.env.VITE_PORT || 4000
|
|
)}`,
|
|
changeOrigin: true,
|
|
secure: false,
|
|
},
|
|
"/lst/ws": {
|
|
target: `ws://localhost:${Number(
|
|
process.env.VITE_PORT || 4000
|
|
)}`, // Your Go WebSocket endpoint
|
|
ws: true,
|
|
changeOrigin: true,
|
|
secure: false,
|
|
rewrite: (path) => path.replace(/^\/ws/, ""),
|
|
},
|
|
},
|
|
},
|
|
});
|