Skip to main content

Overview

The rev-dep files command recursively finds and lists all files that are required by the specified entry point. This helps you understand the complete dependency tree for a given file.

Usage

rev-dep files [flags]

Flags

--condition-names
string[]
List of conditions for package.json imports resolution (e.g. node, imports, default)
-n, --count
boolean
Only display the count of files in the dependency tree
-c, --cwd
string
default:"$PWD"
Working directory for the command
-p, --entry-point
string
required
Entry point file to analyze
--follow-monorepo-packages
string[]
Enable resolution of imports from monorepo workspace packages. Pass without value to follow all, or pass package names
-t, --ignore-type-imports
boolean
Exclude type imports from the analysis
--package-json
string
default:"./package.json"
Path to package.json
--tsconfig-json
string
default:"./tsconfig.json"
Path to tsconfig.json
-v, --verbose
boolean
Show warnings and verbose output
-h, --help
boolean
Help for files command

Examples

List all files in entry point’s dependency tree

rev-dep files --entry-point src/index.ts

Count files in dependency tree

rev-dep files --entry-point src/index.ts --count
Useful for quickly understanding the scope of an entry point.

Analyze with type imports excluded

rev-dep files --entry-point src/index.ts --ignore-type-imports
This shows only runtime dependencies, excluding TypeScript type-only imports.

Analyze with monorepo support

rev-dep files --entry-point packages/app/src/index.ts --follow-monorepo-packages

Use custom TypeScript config

rev-dep files --entry-point src/index.ts --tsconfig-json ./tsconfig.build.json

Use Cases

Use this command to see all files that would be included when bundling or analyzing a specific entry point.
Before making changes to shared utilities, check which entry points depend on them.
Identify overlapping dependencies between entry points to optimize bundle sizes.
  • entry-points - Discover all entry points in the project
  • resolve - Trace the dependency path between specific files
  • imported-by - Find files that import a specific file

Build docs developers (and LLMs) love