Skip to content

Commit 4bd84b3

Browse files
authoredAug 20, 2022
[FIX] Use the 'browser' platform setting for esbuild for Vercel Edge 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
1 parent fc16ed3 commit 4bd84b3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
 

‎.changeset/wet-crews-smoke.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/adapter-vercel': patch
3+
---
4+
5+
Use `platform: 'browser'` for esbuild in Vercel Edge Functions.

‎packages/adapter-vercel/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export default function ({ external = [], edge, split } = {}) {
186186
outfile: `${dirs.functions}/${name}.func/index.js`,
187187
target: 'es2020', // TODO verify what the edge runtime supports
188188
bundle: true,
189-
platform: 'node',
189+
platform: 'browser',
190190
format: 'esm',
191191
external,
192192
sourcemap: 'linked'

0 commit comments

Comments
 (0)
Please sign in to comment.