Skip to content

Commit

Permalink
[FIX] Use the 'browser' platform setting for esbuild for Vercel Edge …
Browse files Browse the repository at this point in the history
…Functions (#6109)

* Use browser platform setting for esbuild

This should use the same esbuild settings as the Cloudflare adapter, as Vercel Edge Functions are based on Cloudflare Workers.

* changeset
  • Loading branch information
SG60 authored Aug 20, 2022
1 parent fc16ed3 commit 4bd84b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/wet-crews-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/adapter-vercel': patch
---

Use `platform: 'browser'` for esbuild in Vercel Edge Functions.
2 changes: 1 addition & 1 deletion packages/adapter-vercel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export default function ({ external = [], edge, split } = {}) {
outfile: `${dirs.functions}/${name}.func/index.js`,
target: 'es2020', // TODO verify what the edge runtime supports
bundle: true,
platform: 'node',
platform: 'browser',
format: 'esm',
external,
sourcemap: 'linked'
Expand Down

0 comments on commit 4bd84b3

Please sign in to comment.