---
title: "Workspaces"
description: "How Doctor activates Rule Packs per workspace package, and the workspace analyses."
canonical_url: "https://vite-doctor.onmax.me/cli/workspaces"
---
# Workspaces

> How Doctor activates Rule Packs per workspace package, and the workspace analyses.

In a workspace declared by `pnpm-workspace.yaml` or the `workspaces` field, Doctor reads every workspace package's `package.json`. Each package activates Rule Packs from its own dependencies, and a Rule Pack runs its file Rules on the files of the packages that activate it, the root included.

If the root depends on Nitro and `packages/app` depends on Vue, the Vue Rules check `packages/app` only, and a `nitro` devDependency at the root checks the root's own files only. `--framework` applies only that framework's Rule Packs, to the whole workspace.

A Rule that declares `meta.activationScope: "workspace"`, such as `nitro/config/require-absolute-generated-paths`, checks every workspace package once its Rule Pack activates anywhere, because the integration code it checks lives outside the packages that run the framework.

The JSON and agent reports list each package under `workspacePackages` with its framework and activated Rule Packs. The top-level `framework` is the workspace root's own.

## Nuxt packages

A workspace package is a Nuxt app when it:

- has a `nuxt.config` or a `.nuxt/doctor.manifest.json`;
- lists `nuxt` in `dependencies`;
- or has `nuxt` in `devDependencies` with an `app.vue` or `pages/` entry.

A Nuxt module package, whose main entry builds from a `src/` file that default-exports `defineNuxtModule()`, counts as Nuxt too, so the module-authoring Rules run on it.

A package that depends on `@nuxt/kit` or exports `./nuxt` without being an app ships a Nuxt module. It keeps its own framework, is marked `nuxtIntegration: true`, and activates the Vue, Nitro, and Nuxt Rule Packs for the code it ships into Nuxt apps. Nuxt routing Rules such as `nuxt/routing/prefer-nuxt-useroute` check Nuxt app files and a Nuxt module's `runtime/` directory, and skip any package that creates its own router with `createRouter` from `vue-router`.

Each Nuxt package keeps its own Nuxt Project Inventory: its `nuxt.config`, `.nuxt/doctor.manifest.json`, server directories, and runtime versions. Nuxt Rules read the inventory of the package that owns the file, so a workspace with several Nuxt apps runs as one Doctor Run. Doctor options set through the `vite-doctor/nuxt` module of a nested Nuxt app apply only when Doctor runs from that app; a workspace run lists them under `evidenceGaps`.

## Workspace analyses

`--analyses` requests graph, dead-code, duplication, or health Diagnostics. They use the source inventory and the project entry points Doctor finds. Pick one or combine them with commas:

```bash
pnpm vite-doctor . --analyses graph
pnpm vite-doctor . --analyses dead-code
pnpm vite-doctor . --analyses dupes
pnpm vite-doctor . --analyses health
pnpm vite-doctor . --analyses graph,dead-code,dupes,health --format json
```

| Analysis | Diagnostic Reference |
| --- | --- |
| `graph` | [DOC0001: circular dependencies](https://vite-doctor.onmax.me/diagnostics/DOC0001) |
| `graph` | [DOC0002: repeated export names](https://vite-doctor.onmax.me/diagnostics/DOC0002) |
| `dead-code` | [DOC0003: undeclared dependencies](https://vite-doctor.onmax.me/diagnostics/DOC0003) |
| `dead-code` | [DOC0004: unresolved source imports](https://vite-doctor.onmax.me/diagnostics/DOC0004) |
| `dead-code` | [DOC0005: apparently unused dependencies](https://vite-doctor.onmax.me/diagnostics/DOC0005) |
| `dead-code` | [DOC0006: unreachable value exports](https://vite-doctor.onmax.me/diagnostics/DOC0006) |
| `dead-code` | [DOC0007: unreachable source files](https://vite-doctor.onmax.me/diagnostics/DOC0007) |
| `dead-code` | [DOC0008: unreachable type exports](https://vite-doctor.onmax.me/diagnostics/DOC0008) |
| `dupes` | [DOC0009: repeated token sequences](https://vite-doctor.onmax.me/diagnostics/DOC0009) |
| `health` | [DOC0010: file-level branch complexity](https://vite-doctor.onmax.me/diagnostics/DOC0010) |
| `health` | [DOC0011: many static imports](https://vite-doctor.onmax.me/diagnostics/DOC0011) |

`--analyses` alone runs only the selected analyses. Add `--rules <rule-id>` to also run a Rule from a Rule Pack.

A reachability Diagnostic is not proof that code is dead. Check runtime loading, public package consumers, and host conventions before you remove anything. Each reference page lists its evidence and limits.


## Sitemap

See the full [sitemap](https://vite-doctor.onmax.me/sitemap.md) for all pages.
