-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
enhancement: pending triagep2-to-be-discussedEnhancement under consideration (priority)Enhancement under consideration (priority)
Description
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:
- Add a "resolveRelativeTo"-type option.
- Allow passing the provider as an import (
provider: import("@vitest/coverage-v8")- wheregetProvider().namewould provide the same info. - Automatically try to resolve imports against any extended config paths.
The provider seems to be resolved in a few places:
!(await ctx.packageInstaller.ensureInstalled(requiredPackages, root, ctx.version)) vitest/packages/browser/src/node/plugin.ts
Line 274 in b67788c
const path = tryResolve('@vitest/coverage-v8', [parentServer.config.root]) const { default: coverageModule } = await loader.import(builtInModule)
Alternative
No response
Additional context
I'm happy to contribute.
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Metadata
Metadata
Assignees
Labels
enhancement: pending triagep2-to-be-discussedEnhancement under consideration (priority)Enhancement under consideration (priority)
Type
Projects
Status
P2 - 3