Skip to content

Commit 7b31da9

Browse files
committed
perf: run serverPrefetch in parallel
1 parent 2598752 commit 7b31da9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/runtime-core/src/apiLifecycle.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ export function onServerPrefetch<
107107
let hook = type.serverPrefetch
108108
if (hook) {
109109
// Merge hook
110-
type.serverPrefetch = () => handler().then(() => (hook as Function)())
110+
type.serverPrefetch = () =>
111+
Promise.all([handler(), (hook as Function)()])
111112
} else {
112113
type.serverPrefetch = handler
113114
}

0 commit comments

Comments
 (0)