Files
juip-web/vite.config.ts
2026-08-14 16:30:41 +08:00

30 lines
701 B
TypeScript

import tailwindcss from "@tailwindcss/vite"
import react from "@vitejs/plugin-react"
import path from "path"
import { defineConfig } from "vite"
// https://vite.dev/config/
export default defineConfig({
plugins: [react(), tailwindcss()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
server: {
proxy: {
"/api": "http://192.168.3.6:5000",
"/user": "http://192.168.3.6:5000",
"/product": {
target: "http://192.168.3.6:5000",
bypass(req) {
if (req.headers?.accept?.includes("text/html")) {
return "/index.html"
}
},
},
"/script": "http://192.168.3.6:5000",
},
},
})