refactor: flip Promise.all to for await for perf!
This commit is contained in:
parent
2bb2b5e8ad
commit
da8a6873f5
1 changed files with 26 additions and 28 deletions
|
@ -55,8 +55,7 @@ export async function collectMdMetadata(
|
|||
viteServer: ViteDevServer,
|
||||
) {
|
||||
const importedModules = [...(modGraph?.importedModules ?? [])];
|
||||
await Promise.all(
|
||||
importedModules.map(async (importedModule) => {
|
||||
for await (let importedModule of importedModules) {
|
||||
// recursively check for importedModules
|
||||
if (!importedModule.id || seenMdMetadata.has(importedModule.id)) return;
|
||||
|
||||
|
@ -85,6 +84,5 @@ export async function collectMdMetadata(
|
|||
for (let mdHydrationDirective of mdMetadata.hydrationDirectives) {
|
||||
metadata.hydrationDirectives.add(mdHydrationDirective);
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue