2026-07-06 06:13:14 +00:00
|
|
|
|
import { defineConfig } from "vite";
|
|
|
|
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
|
plugins: [react()],
|
|
|
|
|
|
server: {
|
|
|
|
|
|
host: "0.0.0.0",
|
|
|
|
|
|
port: 5173,
|
2026-07-07 12:12:04 +00:00
|
|
|
|
// 支援透過 nginx 網域存取開發伺服器(需反向代理轉發)
|
|
|
|
|
|
allowedHosts: [
|
|
|
|
|
|
"threads-tool.30cm.net",
|
|
|
|
|
|
"threads-tool-dev.30cm.net",
|
|
|
|
|
|
"localhost",
|
|
|
|
|
|
],
|
2026-07-06 06:13:14 +00:00
|
|
|
|
// 如果反向代理在 https 並轉發 HMR websocket,請視代理設定調整 hmr
|
|
|
|
|
|
// hmr: {
|
|
|
|
|
|
// host: "threads-tool.30cm.net",
|
|
|
|
|
|
// protocol: "wss",
|
|
|
|
|
|
// },
|
|
|
|
|
|
proxy: {
|
|
|
|
|
|
"/api": {
|
|
|
|
|
|
target: "http://127.0.0.1:8890",
|
|
|
|
|
|
changeOrigin: true
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|