-
-
Notifications
You must be signed in to change notification settings - Fork 2k
fix: add workerd
condition to worker build
#12069
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 26b4628 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
okay, it looks like |
Co-authored-by: Ben McCann <[email protected]>
Co-authored-by: Ben McCann <[email protected]>
Thank you! |
I was wrestling with an issue for one of our users as we couldn't get the Cloudflare build to bundle correctly. I noticed the conditions SvelteKit uses for bundling the Cloudflare Worker file was
['worker', 'browser']
. We hadworkerd
which was the documented condition that Wrangler uses. I thought this might be a better first condition thenworker
.browser
is a safe condition to include for the worker bundle. Browser code likewindow
will throw and it's usually a compile-time checkif (__BROWSER__) window...
. Might be better to resort to things likeserver
/node
/default
? We bundle our package withbrowser
and thendefault
for server files. Not sure what the standard here is, don't think one exists unfortunately or I haven't seen it.Thanks!
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits