Skip to content

Resolve providers relative to config #9304

@mrmckeb

Description

@mrmckeb

Clear and concise description of the problem

We have a monorepo with a shared Vitest config, which defines a provider and coverage reporters.

The current configuration requires us to either install the v8 provider to the monorepo root, or install into each package that uses the shared config.

Ideally, this should be shippable alongside the config (as a dependency).

Suggested solution

I think there are a few options here:

  1. Add a "resolveRelativeTo"-type option.
  2. Allow passing the provider as an import (provider: import("@vitest/coverage-v8") - where getProvider().name would provide the same info.
  3. Automatically try to resolve imports against any extended config paths.

The provider seems to be resolved in a few places:

Alternative

No response

Additional context

I'm happy to contribute.

Validations

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    P2 - 3

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions