diff options
author | 2023-07-05 16:45:58 +0100 | |
---|---|---|
committer | 2023-07-05 16:45:58 +0100 | |
commit | 9e5fafa2b25b5128084c7072aa282642fcfbb14b (patch) | |
tree | 80e21475f93da004a5eae87e3a0d2d6a4f22cce6 /packages/integrations/vercel/src/lib/nft.ts | |
parent | cfd5b2b785ad277b82c380fdf68ead0475ddb42f (diff) | |
download | astro-9e5fafa2b25b5128084c7072aa282642fcfbb14b.tar.gz astro-9e5fafa2b25b5128084c7072aa282642fcfbb14b.tar.zst astro-9e5fafa2b25b5128084c7072aa282642fcfbb14b.zip |
feat: vercel edge middleware support (#7532)
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Diffstat (limited to 'packages/integrations/vercel/src/lib/nft.ts')
-rw-r--r-- | packages/integrations/vercel/src/lib/nft.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/integrations/vercel/src/lib/nft.ts b/packages/integrations/vercel/src/lib/nft.ts index 46604db90..752f87251 100644 --- a/packages/integrations/vercel/src/lib/nft.ts +++ b/packages/integrations/vercel/src/lib/nft.ts @@ -1,7 +1,5 @@ -import { nodeFileTrace } from '@vercel/nft'; import { relative as relativePath } from 'node:path'; import { fileURLToPath } from 'node:url'; - import { copyFilesToFunction } from './fs.js'; export async function copyDependenciesToFunction({ @@ -23,6 +21,11 @@ export async function copyDependenciesToFunction({ base = new URL('../', base); } + // The Vite bundle includes an import to `@vercel/nft` for some reason, + // and that trips up `@vercel/nft` itself during the adapter build. Using a + // dynamic import helps prevent the issue. + // TODO: investigate why + const { nodeFileTrace } = await import('@vercel/nft'); const result = await nodeFileTrace([entryPath], { base: fileURLToPath(base), }); |