perf: 前端路由级代码分割+资源长期缓存;后端列表查询封顶与N+1修复;Dockerfile将依赖烤入.venv根治升级崩溃
This commit is contained in:
1 parent
f5968d0f61
commit
1346fbbd4b
6 files changed
+511
-756
No files matched your search
@@ -13,6 +13,26 @@ export default defineConfig({
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
emptyOutDir: true,
|
||||
// 单个 chunk 体积告警阈值调高,避免大页面触发无意义告警
|
||||
chunkSizeWarningLimit: 1200,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
// 仅将 react 核心库单独打包(长期缓存);
|
||||
// 其余第三方库交给 Rollup 自动按需拆分,避免被强制合并成一个大 vendor 在首屏加载
|
||||
manualChunks(id) {
|
||||
if (id.includes('node_modules')) {
|
||||
if (
|
||||
id.includes('react-router') ||
|
||||
id.includes('/react/') ||
|
||||
id.includes('react-dom') ||
|
||||
id.includes('scheduler')
|
||||
) {
|
||||
return 'react-vendor';
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
server: {
|
||||
port: 5173,
|
||||
|
||||
Reference in new issue
Block a user