Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/popular-chairs-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@sveltejs/adapter-cloudflare-workers": patch
"@sveltejs/adapter-cloudflare": patch
---

add `workerd` condition to cloudflare worker file build
Comment thread
teemingc marked this conversation as resolved.
Outdated
3 changes: 2 additions & 1 deletion packages/adapter-cloudflare-workers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ export default function ({ config = 'wrangler.toml' } = {}) {
try {
const result = await esbuild.build({
platform: 'browser',
conditions: ['worker', 'browser'],
// https://github.com/cloudflare/workers-sdk/blob/a12b2786ce745f24475174bcec994ad691e65b0f/packages/wrangler/src/deployment-bundle/bundle.ts#L35-L36
conditions: ['workerd', 'worker', 'browser'],
Comment thread
teemingc marked this conversation as resolved.
sourcemap: 'linked',
target: 'es2022',
entryPoints: [`${tmp}/entry.js`],
Expand Down
3 changes: 2 additions & 1 deletion packages/adapter-cloudflare/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ export default function (options = {}) {
try {
const result = await esbuild.build({
platform: 'browser',
conditions: ['worker', 'browser'],
// https://github.com/cloudflare/workers-sdk/blob/a12b2786ce745f24475174bcec994ad691e65b0f/packages/wrangler/src/deployment-bundle/bundle.ts#L35-L36
conditions: ['workerd', 'worker', 'browser'],
Comment thread
teemingc marked this conversation as resolved.
sourcemap: 'linked',
target: 'es2022',
entryPoints: [`${tmp}/_worker.js`],
Expand Down