Monorepo Projects in Vitest

From the Vitest cheat sheet ยท Test Projects ยท verified Nov 2026

Monorepo Projects

Point Vitest at every package in a monorepo and configure each with defineProject

typescript
// vitest.config.ts at the repo root
export default defineConfig({
  test: {
    projects: ['packages/*'],
  },
})
๐Ÿ’ก Use defineProject in package configs for project-safe typing
๐Ÿ“Œ Referenced config files don't inherit the root config
๐Ÿ” process.cwd() stays at the root even inside a project
โšก test.projects replaced the old vitest.workspace file (3.2+)
projectsmonorepodefineProject

Continue with Vitest

Save the full cheat sheet or work through every related task.

More Vitest tasks

Back to the full Vitest cheat sheet