thread-master/old/backend/web/vite.config.ts

32 lines
776 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";
export default defineConfig({
plugins: [react()],
server: {
host: "0.0.0.0",
port: 5173,
// 支援透過 nginx 網域存取開發伺服器(需反向代理轉發)
allowedHosts: [
"threads-tool.30cm.net",
"threads-tool-dev.30cm.net",
"localhost",
],
// 如果反向代理在 https 並轉發 HMR websocket請視代理設定調整 hmr
// hmr: {
// host: "threads-tool.30cm.net",
// protocol: "wss",
// },
proxy: {
"/api": {
target: "http://127.0.0.1:8890",
changeOrigin: true
},
"/haixun-assets": {
target: "http://127.0.0.1:9000",
changeOrigin: true
}
}
}
});