thread-master/apps/web/vite.config.ts

32 lines
827 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
server: {
host: "0.0.0.0",
port: 5173,
strictPort: false,
allowedHosts: ["threads-tool-dev.30cm.net", ".30cm.net"],
proxy: {
// Live API → gateway
"/api": {
target: "http://127.0.0.1:8888",
changeOrigin: true,
},
// 頭像等公開物件MinIO path-style。nginx 未轉 /haixun-assets 時,
// 流量會落到 Vite由此代轉避免回 SPA HTML。
"/haixun-assets": {
target: "http://127.0.0.1:9000",
changeOrigin: true,
},
},
},
preview: {
host: "0.0.0.0",
port: 4173,
allowedHosts: ["threads-tool-dev.30cm.net", ".30cm.net"],
},
});