perf: delay admin prefetch after first screen
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ function warmAdminRuntimeAfterPaint() {
|
|||||||
void ensureAdminRuntime().catch(() => undefined);
|
void ensureAdminRuntime().catch(() => undefined);
|
||||||
};
|
};
|
||||||
|
|
||||||
window.setTimeout(run, 350);
|
window.setTimeout(run, 2_500);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user