chore: admin 构建稳定 vendor 分包,消除 chunk 告警;更新 .env.example 品牌文案与端口
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user