diff options
author | 2021-03-21 16:16:18 -0700 | |
---|---|---|
committer | 2021-03-21 16:16:18 -0700 | |
commit | e03afbd980f4e0226136b3324c6f166ec8a18a8e (patch) | |
tree | 5c0112bb0f700512ca640c9104b607407e5d73b1 /src | |
parent | 558ef18b58d8f0fd2894eb02fce07c062aab81d3 (diff) | |
download | astro-e03afbd980f4e0226136b3324c6f166ec8a18a8e.tar.gz astro-e03afbd980f4e0226136b3324c6f166ec8a18a8e.tar.zst astro-e03afbd980f4e0226136b3324c6f166ec8a18a8e.zip |
add fetch support
Diffstat (limited to 'src')
-rw-r--r-- | src/transform2.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/transform2.ts b/src/transform2.ts index fcbb6e14f..ea95b0f32 100644 --- a/src/transform2.ts +++ b/src/transform2.ts @@ -152,11 +152,12 @@ export async function __renderPage({request, children}) { const isRoot = true; const merge = (await import('deepmerge')).default; + const fetch = (await import('node-fetch')).default; // call all children setup scripts, in order, and return. let mergedContext = {}; for (const child of [currentChild, ...children]) { - const childSetupResult = await child.setup({request, context: mergedContext}); + const childSetupResult = await child.setup({request, fetch, context: mergedContext}); mergedContext = childSetupResult.context ? merge(mergedContext, childSetupResult.context) : mergedContext; } |