summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/astro/src/content/runtime.ts48
1 files changed, 25 insertions, 23 deletions
diff --git a/packages/astro/src/content/runtime.ts b/packages/astro/src/content/runtime.ts
index 0ad74de3e..c4fc85739 100644
--- a/packages/astro/src/content/runtime.ts
+++ b/packages/astro/src/content/runtime.ts
@@ -83,29 +83,31 @@ export function createGetCollection({
} else {
const limit = pLimit(10);
entries = await Promise.all(
- lazyImports.map((lazyImport) => limit(async () => {
- const entry = await lazyImport();
- return type === 'content'
- ? {
- id: entry.id,
- slug: entry.slug,
- body: entry.body,
- collection: entry.collection,
- data: entry.data,
- async render() {
- return render({
- collection: entry.collection,
- id: entry.id,
- renderEntryImport: await getRenderEntryImport(collection, entry.slug),
- });
- },
- }
- : {
- id: entry.id,
- collection: entry.collection,
- data: entry.data,
- };
- }))
+ lazyImports.map((lazyImport) =>
+ limit(async () => {
+ const entry = await lazyImport();
+ return type === 'content'
+ ? {
+ id: entry.id,
+ slug: entry.slug,
+ body: entry.body,
+ collection: entry.collection,
+ data: entry.data,
+ async render() {
+ return render({
+ collection: entry.collection,
+ id: entry.id,
+ renderEntryImport: await getRenderEntryImport(collection, entry.slug),
+ });
+ },
+ }
+ : {
+ id: entry.id,
+ collection: entry.collection,
+ data: entry.data,
+ };
+ })
+ )
);
cacheEntriesByCollection.set(collection, entries);
}