Skip to content
This repository has been archived by the owner on Feb 10, 2025. It is now read-only.

Commit

Permalink
Update target
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Jan 23, 2025
1 parent 757dbb1 commit e5b6158
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .changeset/grumpy-phones-explode.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@astrojs/vercel': patch
---

Updates edge middleware to support es2022 syntax
Updates edge middleware to support esnext syntax
4 changes: 3 additions & 1 deletion packages/vercel/src/serverless/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export async function generateEdgeMiddleware(
contents: code,
resolveDir: fileURLToPath(root),
},
target: 'es2022',
// Vercel Edge runtime targets ESNext, because Cloudflare Workers update v8 weekly
// https://github.com/vercel/vercel/blob/1006f2ae9d67ea4b3cbb1073e79d14d063d42436/packages/next/scripts/build-edge-function-template.js
target: 'esnext',
platform: 'browser',
// esbuild automatically adds the browser, import and default conditions
// https://esbuild.github.io/api/#conditions
Expand Down

0 comments on commit e5b6158

Please sign in to comment.