2026-07-23 01:48:00 +08:00
|
|
|
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}`);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
});
|