build: set base path to /aura/ for subpath deployment

main
sp mac bookpro 2605 2026-05-28 00:47:02 +08:00
parent 9536c2c927
commit 83e4fab788
1 changed files with 7 additions and 5 deletions

View File

@ -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: {