finance-tools/vite.config.ts

17 lines
471 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";
// 開發期把資料請求轉發到同目錄的 MacroScope 後端(預設 :3000
const API_TARGET = process.env.API_TARGET || "http://localhost:3000";
export default defineConfig({
plugins: [react()],
server: {
port: 5173,
proxy: {
"/api": { target: API_TARGET, changeOrigin: true },
"/book-patterns": { target: API_TARGET, changeOrigin: true },
},
},
});