Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 6b077cc

Browse files
move the workerd resolve.conditions setting to the env level (and add missing defaults)
1 parent cd6d5fa commit 6b077cc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ export function createCloudflareEnvironmentOptions(
135135
// Note: in order for ssr pre-bundling to take effect we need to ask vite to treat all
136136
// dependencies as not external
137137
noExternal: true,
138+
// We want to use `workerd` package exports if available (e.g. for postgres).
139+
conditions: ['workerd', 'module', 'browser', 'development|production'],
138140
},
139141
dev: {
140142
createEnvironment(name, config) {

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ export function cloudflare<T extends Record<string, WorkerOptions>>(
3333
return {
3434
resolve: {
3535
alias: getNodeCompatAliases(),
36-
// We want to use `workerd` package exports if available (e.g. for postgres).
37-
conditions: ['workerd'],
3836
},
3937
appType: 'custom',
4038
builder: {

0 commit comments

Comments
 (0)