File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
packages/vitest/src/node/plugins Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,18 @@ export async function VitestPlugin(
113
113
// https://github.com/vitejs/vite/pull/16453
114
114
emptyOutDir : false ,
115
115
} ,
116
+ // eslint-disable-next-line ts/ban-ts-comment
117
+ // @ts -ignore Vite 6 compat
118
+ environments : {
119
+ ssr : {
120
+ resolve : {
121
+ // by default Vite resolves `module` field, which not always a native ESM module
122
+ // setting this option can bypass that and fallback to cjs version
123
+ mainFields : [ ] ,
124
+ conditions : [ 'node' ] ,
125
+ } ,
126
+ } ,
127
+ } ,
116
128
test : {
117
129
poolOptions : {
118
130
threads : {
Original file line number Diff line number Diff line change @@ -96,6 +96,18 @@ export function WorkspaceVitestPlugin(
96
96
) ,
97
97
} ,
98
98
} ,
99
+ // eslint-disable-next-line ts/ban-ts-comment
100
+ // @ts -ignore Vite 6 compat
101
+ environments : {
102
+ ssr : {
103
+ resolve : {
104
+ // by default Vite resolves `module` field, which not always a native ESM module
105
+ // setting this option can bypass that and fallback to cjs version
106
+ mainFields : [ ] ,
107
+ conditions : [ 'node' ] ,
108
+ } ,
109
+ } ,
110
+ } ,
99
111
test : {
100
112
name,
101
113
} ,
You can’t perform that action at this time.
0 commit comments