guanghu-research/vite.config.ts

25 lines
626 B
TypeScript
Raw Permalink Normal View History

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
const GITEA_TOKEN = "f84a31ef0be84fe25f3b344bfd847583bf7796d2";
export default defineConfig({
plugins: [react()],
server: {
port: 5173,
open: true,
proxy: {
"/gitea-api": {
target: "https://guanghutansuohe.com",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/gitea-api/, "/code/api/v1"),
configure: (proxy) => {
proxy.on("proxyReq", (proxyReq) => {
proxyReq.setHeader("Authorization", `token ${GITEA_TOKEN}`);
});
},
},
},
},
});