Skip to content

config hook of injected plugins from test projects no longer receives resolve.conditions or resolve.mainfields values #8120

@dominikg

Description

@dominikg

Describe the bug

prior to vitest 3.2.0, up until 3.2.0-beta.3, plugins added through test config received config.resolve.conditions values, now they are undefined.

this breaks a utility plugin in @testing-library/svelte used by sveltes official vitest template sv add vitest to inject the browser condition after the node condition for client tests.

reported here: sveltejs/cli#579

utility plugin code https://github.com/testing-library/svelte-testing-library/blob/main/src/vite.js#L47
the inject of browser condition does not happen because indexOf node condition is -1

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-xdsbmkd6?file=vite.config.ts

see console output, first run with 3.2.0 logs undefined, second run with 3.2.0-beta.3 logs node,development|production

System Info

stackblitz, vitest 3.2.0

Used Package Manager

pnpm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: workspaceIssues and PRs related to the workspace featurep4-importantViolate documented behavior or significantly improves performance (priority)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions