48 lines
1.0 KiB
TypeScript
48 lines
1.0 KiB
TypeScript
import path from "node:path";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import { tanstackRouter } from "@tanstack/router-plugin/vite";
|
|
import react from "@vitejs/plugin-react-swc";
|
|
import { defineConfig } from "vite";
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
tailwindcss(),
|
|
tanstackRouter({
|
|
target: "react",
|
|
autoCodeSplitting: true,
|
|
}),
|
|
react(),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
base: "/lst/app",
|
|
build: {
|
|
//outDir: "../backend/frontend",
|
|
//assetsDir: "assets",
|
|
emptyOutDir: true,
|
|
},
|
|
server: {
|
|
port: 5500,
|
|
host: true,
|
|
allowedHosts: true,
|
|
proxy: {
|
|
"/lst/api": {
|
|
target: `http://localhost:${Number(process.env.VITE_PORT || 3000)}`,
|
|
changeOrigin: true,
|
|
secure: false,
|
|
},
|
|
"/lst/ws": {
|
|
target: `ws://localhost:${Number(process.env.VITE_PORT || 3000)}`, // Your Go WebSocket endpoint
|
|
ws: true,
|
|
changeOrigin: true,
|
|
secure: false,
|
|
rewrite: (path) => path.replace(/^\/ws/, ""),
|
|
},
|
|
},
|
|
},
|
|
});
|