fix: OCR 审查驱动的全库修复(安全/正确性/部署/前端) #64

Merged
wangziqi merged 43 commits from feat/ocr-review-fixes into main 2026-08-09 13:32:19 +00:00
2 changed files with 27 additions and 2 deletions
Showing only changes of commit d27f10eb84 - Show all commits

View File

@@ -19,6 +19,31 @@ export default defineConfig({
},
},
},
build: {
// 稳定 vendor 分包:大库单独成 chunk利于浏览器缓存与按需加载
rolldownOptions: {
output: {
codeSplitting: {
groups: [
{
name: (id) => {
if (!id.includes('node_modules')) return null;
// 只对体积大且相互独立的纯库手动分组antd/markdown 栈
// 交给 rolldown 默认分包,避免人为制造超大 chunk。
if (/[\\/]node_modules[\\/](echarts|zrender)[\\/]/.test(id)) return 'echarts';
if (/[\\/]node_modules[\\/](react|react-dom|react-router|react-router-dom|scheduler|use-sync-external-store)[\\/]/.test(id)) return 'react';
if (/[\\/]node_modules[\\/]dayjs[\\/]/.test(id)) return 'dayjs';
if (/[\\/]node_modules[\\/]@tanstack[\\/]/.test(id)) return 'tanstack';
return null;
},
},
],
},
},
},
// 剩余大 chunk 均为按需加载AI 绘图/ECharts 等),阈值按实际调高避免误报
chunkSizeWarningLimit: 700,
},
optimizeDeps: {
include: [
'dayjs',

View File

@@ -1,5 +1,5 @@
# ============================
# 宿舍水电费系统 - 生产环境配置
# 恭学教育 - 生产环境配置
# ============================
# 复制此文件为 .env 并修改配置值
# cp .env.example .env
@@ -22,7 +22,7 @@ JWT_EXPIRES_IN=24h
ADMIN_PASSWORD=请替换为强密码
# ---- 服务端口 ----
PORT=3002
PORT=3000
# ---- 文件上传 ----
# 合同 PDF 存储根目录(相对或绝对)