38 lines
910 B
TypeScript
38 lines
910 B
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
export default defineConfig({
|
|
root: path.resolve(__dirname, "client"),
|
|
plugins: [react(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "client/src"),
|
|
"@shared": path.resolve(__dirname, "shared"),
|
|
},
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
host: true,
|
|
proxy: {
|
|
"/api": {
|
|
target: "http://localhost:5000",
|
|
changeOrigin: true,
|
|
},
|
|
"/socket.io": {
|
|
target: "http://localhost:5000",
|
|
changeOrigin: true,
|
|
ws: true,
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
outDir: path.resolve(__dirname, "dist/client"),
|
|
emptyOutDir: true,
|
|
sourcemap: false,
|
|
},
|
|
});
|