Files
memind_adm/vite.config.ts
T
john 8af8676ad5 收口 memind_adm 主线并切换 103 为无源码产物发布。
统一共享用户/计费/空间额度能力,新增 Ops 与套餐同步,并以 release-prod.sh 作为唯一生产发布入口。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 12:31:25 +08:00

41 lines
1.0 KiB
TypeScript

import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
const backendTarget = env.ADM_DEV_BACKEND ?? 'http://127.0.0.1:8085';
const basePath = env.VITE_BASE_PATH?.trim() || '/';
return {
base: basePath.endsWith('/') ? basePath : `${basePath}/`,
plugins: [react()],
server: {
host: true,
port: 5174,
strictPort: true,
allowedHosts: ['gadm.tkmind.cn', 'localhost', '127.0.0.1'],
proxy: {
'/api': backendTarget,
'/auth': backendTarget,
'/admin-api': backendTarget,
},
},
preview: {
host: '127.0.0.1',
port: 5174,
strictPort: true,
allowedHosts: ['gadm.tkmind.cn', 'localhost', '127.0.0.1'],
proxy: {
'/api': backendTarget,
'/auth': backendTarget,
'/admin-api': backendTarget,
},
},
build: {
outDir: 'dist',
emptyOutDir: true,
},
};
});