[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

chore: set `resolve.mainFields` and `resolve.conditions` for SSR environment (#6896)

authored by

翠 / green and committed by
GitHub
(Nov 13, 2024, 11:54 AM +0100) 251893b4 76169a15

+24
+12
packages/vitest/src/node/plugins/index.ts
··· 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: {
+12
packages/vitest/src/node/plugins/workspace.ts
··· 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 },