build: set base path to /aura/ for subpath deployment
parent
9536c2c927
commit
83e4fab788
|
|
@ -2,11 +2,13 @@ import { defineConfig, loadEnv } from 'vite';
|
||||||
import react from '@vitejs/plugin-react';
|
import react from '@vitejs/plugin-react';
|
||||||
|
|
||||||
// 默认走 Go 后端 :4001;要回退 Node 后端就 set VITE_API_TARGET=http://localhost:4000
|
// 默认走 Go 后端 :4001;要回退 Node 后端就 set VITE_API_TARGET=http://localhost:4000
|
||||||
export default defineConfig(({ mode }) => {
|
export default defineConfig(({ mode }) => {
|
||||||
const env = loadEnv(mode, process.cwd(), '');
|
const env = loadEnv(mode, process.cwd(), '');
|
||||||
const target = env.VITE_API_TARGET || 'https://api.hoyidata.com';
|
const target = env.VITE_API_TARGET || 'https://api.hoyidata.com';
|
||||||
return {
|
|
||||||
plugins: [react()],
|
return {
|
||||||
|
base: '/aura/', // <-- 关键修改:设置构建的基础路径
|
||||||
|
plugins: [react()],
|
||||||
server: {
|
server: {
|
||||||
port: 3001,
|
port: 3001,
|
||||||
proxy: {
|
proxy: {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue