Files
Genarrative/apps/admin-web/vite.config.ts
T
suzmii 44f02ee19b 完善游戏审核试玩与客户端版本更新
后台审核详情复用公开游戏详情样式,补齐发布者、冻结资料、素材换签和待审 ZIP 试玩。

AGC 保存已发布作品绑定,支持同一 gameId 更新版本并由用户填写目标版本号。

保留 SpacetimeDB 表结构不变,增加版本号请求校验、幂等边界和本地清单字段。
2026-10-03 12:35:57 +08:00

70 lines
1.9 KiB
TypeScript

import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import react from '@vitejs/plugin-react';
import { defineConfig, loadEnv } from 'vite';
const adminWebRoot = dirname(fileURLToPath(import.meta.url));
const repoRoot = resolve(adminWebRoot, '../..');
export default defineConfig(({ command, mode }) => {
const repoEnv = loadEnv(mode, repoRoot, '');
const appEnv = loadEnv(mode, adminWebRoot, '');
const env = { ...repoEnv, ...appEnv };
const apiTarget =
env.ADMIN_API_TARGET ||
env.GENARRATIVE_API_TARGET ||
`http://127.0.0.1:${env.GENARRATIVE_API_PORT || '3100'}`;
const base = env.ADMIN_WEB_BASE || '/admin/';
const ignoredWatchGlobs = [
'**/.git/**',
'**/.worktrees/**',
'**/dist/**',
'**/node_modules/**',
'**/server-rs/**',
'**/server-rs/target/**',
];
return {
root: adminWebRoot,
publicDir: command === 'serve' ? resolve(repoRoot, 'public') : false,
envDir: repoRoot,
base,
plugins: [react()],
server: {
watch: {
ignored: ignoredWatchGlobs,
},
proxy: {
'/admin/api': {
target: apiTarget,
changeOrigin: true,
secure: false,
},
'/api/assets': {
target: apiTarget,
changeOrigin: true,
secure: false,
},
'/api/game-distribution/admin-previews': {
target: apiTarget,
changeOrigin: true,
secure: false,
},
'/healthz': {
target: apiTarget,
changeOrigin: true,
secure: false,
},
},
},
build: {
outDir: 'dist',
emptyOutDir: true,
// 中文注释:后台单页 chunk 已增长到 600.23 kB;沿用 2026-05-01 把 500 提到 600 的同一处理口径
// 提到 700,先让直推 master 的构建门禁恢复可过,真正的按路由拆分另行排期。
chunkSizeWarningLimit: 700,
},
};
});