Files
hspguard/web/vite.config.ts
2025-05-24 20:58:09 +02:00

34 lines
735 B
TypeScript

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
import { resolve } from "path";
// https://vite.dev/config/
export default defineConfig(({ mode }) => ({
plugins: [react(), tailwindcss()],
server:
mode === "development"
? {
proxy: {
"/api": {
target: "http://127.0.0.1:3001",
changeOrigin: true,
secure: false,
},
},
allowedHosts: true,
host: "0.0.0.0",
}
: undefined,
build: {
outDir: "../dist",
emptyOutDir: true,
},
resolve: {
alias: {
"@": resolve(__dirname, "src"),
},
},
base: "/",
}));