Skip to content

Commit f06e2ab

Browse files
committed
fix: add workerd condition to cloudflare worker build
1 parent 38294be commit f06e2ab

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.changeset/popular-chairs-pull.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@sveltejs/adapter-cloudflare-workers": major
3+
"@sveltejs/adapter-cloudflare": major
4+
---
5+
6+
add `workerd` condition to cloudflare worker file build

packages/adapter-cloudflare-workers/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export default function ({ config = 'wrangler.toml' } = {}) {
8686
try {
8787
const result = await esbuild.build({
8888
platform: 'browser',
89-
conditions: ['worker', 'browser'],
89+
conditions: ['workerd', 'worker', 'browser'],
9090
sourcemap: 'linked',
9191
target: 'es2022',
9292
entryPoints: [`${tmp}/entry.js`],

packages/adapter-cloudflare/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default function (options = {}) {
7474
try {
7575
const result = await esbuild.build({
7676
platform: 'browser',
77-
conditions: ['worker', 'browser'],
77+
conditions: ['workerd', 'worker', 'browser'],
7878
sourcemap: 'linked',
7979
target: 'es2022',
8080
entryPoints: [`${tmp}/_worker.js`],

0 commit comments

Comments
 (0)