Skip to content

Commit cbe1af0

Browse files
committed
feat: Run extendPageData functions in parallel
1 parent 9dce835 commit cbe1af0

File tree

1 file changed

+5
-1
lines changed
  • packages/@vuepress/core/lib/node

1 file changed

+5
-1
lines changed

packages/@vuepress/core/lib/node/Page.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,17 @@ module.exports = class Page {
286286
*/
287287

288288
async enhance (enhancers) {
289+
const enhancerPromises = []
290+
289291
for (const { name: pluginName, value: enhancer } of enhancers) {
290292
try {
291-
await enhancer(this)
293+
enhancerPromises.push(enhancer(this))
292294
} catch (error) {
293295
console.log(error)
294296
throw new Error(`[${pluginName}] execute extendPageData failed.`)
295297
}
296298
}
299+
300+
return Promise.all(enhancerPromises)
297301
}
298302
}

0 commit comments

Comments
 (0)