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(
113113 // https://github.com/vitejs/vite/pull/16453
114114 emptyOutDir : false ,
115115 } ,
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+ } ,
116128 test : {
117129 poolOptions : {
118130 threads : {
Original file line number Diff line number Diff line change @@ -96,6 +96,18 @@ export function WorkspaceVitestPlugin(
9696 ) ,
9797 } ,
9898 } ,
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+ } ,
99111 test : {
100112 name,
101113 } ,
You can’t perform that action at this time.
0 commit comments