perf: delay admin prefetch after first screen

This commit is contained in:
2026-06-22 15:11:11 +08:00
parent 75a7671a27
commit 84d6791b3c
3 changed files with 3 additions and 6 deletions
+2 -2
View File
@@ -112,7 +112,7 @@ function prefetchLightPages(pageMap: ComponentRecordType) {
scheduleLightPrefetch(() => { scheduleLightPrefetch(() => {
void ensureAdminRuntime().catch(() => undefined); void ensureAdminRuntime().catch(() => undefined);
}, 250); }, 2_800);
for (const [index, key] of PREFETCH_LIGHT_PAGE_KEYS.entries()) { for (const [index, key] of PREFETCH_LIGHT_PAGE_KEYS.entries()) {
scheduleLightPrefetch(() => { scheduleLightPrefetch(() => {
@@ -120,7 +120,7 @@ function prefetchLightPages(pageMap: ComponentRecordType) {
if (typeof loader === 'function') { if (typeof loader === 'function') {
void loader().catch(() => undefined); void loader().catch(() => undefined);
} }
}, 450 + index * 160); }, 3_200 + index * 220);
} }
} }
+1 -1
View File
@@ -35,7 +35,7 @@ function warmAdminRuntimeAfterPaint() {
void ensureAdminRuntime().catch(() => undefined); void ensureAdminRuntime().catch(() => undefined);
}; };
window.setTimeout(run, 350); window.setTimeout(run, 2_500);
} }
/** /**
-3
View File
@@ -31,9 +31,6 @@ export default defineConfig(async (config) => {
vxeTableLazyImport: false, vxeTableLazyImport: false,
}, },
vite: { vite: {
build: {
modulePreload: false,
},
define: { define: {
'import.meta.env.VITE_APP_VERSION': JSON.stringify(appVersion), 'import.meta.env.VITE_APP_VERSION': JSON.stringify(appVersion),
}, },