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