Skip to content

Commit e7db0a5

Browse files
authored
Fix vite 6 resolve conditions (#2863)
* Update resolve conditions for vite 6
1 parent 2aff369 commit e7db0a5

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

.changeset/blue-horses-arrive.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@shopify/mini-oxygen": patch
3+
---
4+
5+
Update resolve conditions for vite 6

package-lock.json

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/mini-oxygen/src/vite/plugin.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {defaultClientConditions} from 'vite';
12
import path from 'node:path';
23
import type {Plugin, ResolvedConfig} from 'vite';
34
import {
@@ -45,11 +46,14 @@ export function oxygen(pluginOptions: OxygenPluginOptions = {}): Plugin[] {
4546
return {
4647
appType: 'custom',
4748
resolve: {
48-
conditions: ['worker', 'workerd'],
49+
conditions: ['worker', 'workerd', ...defaultClientConditions],
4950
},
5051
ssr: {
5152
noExternal: true,
5253
target: 'webworker',
54+
resolve: {
55+
conditions: ['worker', 'workerd', ...defaultClientConditions],
56+
},
5357
},
5458
// When building, the CLI will set the `ssr` option to `true`
5559
// if no --entry flag is passed for the default SSR entry file.

0 commit comments

Comments
 (0)