Skip to content

Commit bc910f9

Browse files
add worker to Vite plugin default conditions (#10054)
* add worker to default conditions * add changeset --------- Co-authored-by: James Opstad <[email protected]>
1 parent 8e9906c commit bc910f9

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/social-geckos-leave.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@cloudflare/vite-plugin": patch
3+
---
4+
5+
Add `worker` to the default conditions for resolving packages
6+
7+
This makes it consistent with the conditions used when bundling Worker code with Wrangler.

packages/vite-plugin-cloudflare/src/cloudflare-environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export const cloudflareBuiltInModules = [
125125
"cloudflare:workflows",
126126
];
127127

128-
const defaultConditions = ["workerd", "module", "browser"];
128+
const defaultConditions = ["workerd", "worker", "module", "browser"];
129129
const target = "es2022";
130130

131131
export function createCloudflareEnvironmentOptions(

0 commit comments

Comments
 (0)