> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fallow.tools/llms.txt
> Use this file to discover all available pages before exploring further.

# Production mode

> Restrict fallow's dead code analysis to production code by excluding test files, devDependencies, and type-only imports.

Production mode restricts analysis to code that ships to users, ignoring test and development files.

```bash theme={null}
fallow dead-code --production
```

Or set it in your config:

```jsonc theme={null}
// .fallowrc.json
{
  "production": true
}
```

## What changes in production mode

| Behavior                                          | Default     | Production                                                                                                                                                       |
| :------------------------------------------------ | :---------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Test files (`*.test.*`, `*.spec.*`, `__tests__/`) | Included    | Excluded                                                                                                                                                         |
| Story files (`*.stories.*`)                       | Included    | Excluded                                                                                                                                                         |
| Mock files (`__mocks__/`)                         | Included    | Excluded                                                                                                                                                         |
| Package.json scripts analyzed                     | All         | Only `start`, `build`, `serve`, `preview`, `prepare`, `prepublishOnly`, `postinstall`, and `pre`/`post` lifecycle hooks for `start`, `build`, `serve`, `install` |
| Unused devDependencies                            | Reported    | Skipped                                                                                                                                                          |
| Type-only dependencies                            | Not flagged | Flagged (should be devDependencies)                                                                                                                              |

```bash title="$ fallow dead-code --production" theme={null}
● Unused exports (2)
  src/utils/format.ts
    :12 formatCurrency
    :28 formatPercentage
  Exported symbols with zero references — https://docs.fallow.tools/explanations/dead-code#unused-exports

● Unused dependencies (1)
  moment
  Packages in dependencies never imported — https://docs.fallow.tools/explanations/dead-code#unused-dependencies

● Type-only dependencies (1)
  zod  →  move to devDependencies (only imported via 'import type')
  Production dependencies only used as types — https://docs.fallow.tools/explanations/dead-code#type-only-dependencies

✗ 4 issues (19ms, production mode, 623/847 files)
```

## Type-only dependency detection

In production mode, fallow detects dependencies that are only imported via `import type`:

```ts theme={null}
import type { Config } from 'some-package';  // Type-only, erased at runtime
```

These packages belong in `devDependencies` since types are erased at runtime and don't need to be installed in production.

<Tip>
  In monorepos, production mode catches dependencies that should be devDependencies, keeping each package's install footprint minimal.
</Tip>

## See also

<CardGroup cols={2}>
  <Card title="CI Integration" icon="circle-check" href="/integrations/ci">
    Use production mode in your CI pipeline for lean, fast checks.
  </Card>

  <Card title="Rules & Severity" icon="scale-balanced" href="/configuration/rules">
    Control which issue types are errors, warnings, or disabled.
  </Card>
</CardGroup>
