From 83e4fab7888dd83e0c950b07fa6ece6bbb7d83fd Mon Sep 17 00:00:00 2001 From: sp mac bookpro 2605 Date: Thu, 28 May 2026 00:47:02 +0800 Subject: [PATCH] build: set base path to /aura/ for subpath deployment --- vite.config.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index 1a599fe..4672a71 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,11 +2,13 @@ import { defineConfig, loadEnv } from 'vite'; import react from '@vitejs/plugin-react'; // 默认走 Go 后端 :4001;要回退 Node 后端就 set VITE_API_TARGET=http://localhost:4000 -export default defineConfig(({ mode }) => { - const env = loadEnv(mode, process.cwd(), ''); - const target = env.VITE_API_TARGET || 'https://api.hoyidata.com'; - return { - plugins: [react()], +export default defineConfig(({ mode }) => { + const env = loadEnv(mode, process.cwd(), ''); + const target = env.VITE_API_TARGET || 'https://api.hoyidata.com'; + + return { + base: '/aura/', // <-- 关键修改:设置构建的基础路径 + plugins: [react()], server: { port: 3001, proxy: {