Skip to content

Commit

Permalink
move the workerd resolve.conditions setting to the env level (and…
Browse files Browse the repository at this point in the history
… add missing defaults)
  • Loading branch information
dario-piotrowicz committed Nov 7, 2024
1 parent cd6d5fa commit 6b077cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/vite-plugin-cloudflare/src/cloudflare-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ export function createCloudflareEnvironmentOptions(
// Note: in order for ssr pre-bundling to take effect we need to ask vite to treat all
// dependencies as not external
noExternal: true,
// We want to use `workerd` package exports if available (e.g. for postgres).
conditions: ['workerd', 'module', 'browser', 'development|production'],
},
dev: {
createEnvironment(name, config) {
Expand Down
2 changes: 0 additions & 2 deletions packages/vite-plugin-cloudflare/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ export function cloudflare<T extends Record<string, WorkerOptions>>(
return {
resolve: {
alias: getNodeCompatAliases(),
// We want to use `workerd` package exports if available (e.g. for postgres).
conditions: ['workerd'],
},
appType: 'custom',
builder: {
Expand Down

0 comments on commit 6b077cc

Please sign in to comment.