Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: always use node condition #1919

Merged
merged 8 commits into from Oct 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -75,7 +75,7 @@
"pnpm": {
"overrides": {
"esbuild": "^0.14.47",
"vite": "^3.1.0",
"vite": "^3.2.0",
"vitest": "workspace:*",
"rollup": "^2.79.0"
}
Expand Down
4 changes: 4 additions & 0 deletions packages/vitest/src/node/plugins/index.ts
Expand Up @@ -90,6 +90,10 @@ export async function VitestPlugin(options: UserConfig = {}, ctx = new Vitest('t
// setting this option can bypass that and fallback to cjs version
mainFields: [],
alias: preOptions.alias,
conditions: ['node'],
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
// @ts-ignore we support Vite ^3.0, but browserField is available in Vite ^3.2
browserField: false,
},
server: {
...preOptions.api,
Expand Down