Overview
Therev-dep resolve command analyzes and displays the dependency chain between specified files. This helps you understand how different parts of your codebase are connected and why a particular file is included in an entry point’s bundle.
Usage
Flags
Show all possible resolution paths, not just the first one
Display a compact summary of found paths
List of conditions for package.json imports resolution (e.g. node, imports, default)
Working directory for the command
Entry point file(s) or glob pattern(s) to start analysis from (default: auto-detected)
Target file to check for dependencies
Enable resolution of imports from monorepo workspace packages. Pass without value to follow all, or pass package names
Glob patterns to exclude files from dependency analysis
Exclude type imports from the analysis
Target node module name to check for dependencies
Path to package.json
Path to tsconfig.json
Show warnings and verbose output
Help for resolve command
Examples
Find path between entry point and file
src/index.ts to src/utils/helpers.ts.
Find all paths to a file
Check if a module is used
lodash module is reached from your entry point.
Use glob pattern for entry points
Compact summary view
Exclude test files from path analysis
Use Cases
Debug unexpected imports
Debug unexpected imports
When a file appears in your bundle unexpectedly, use this command to trace how it’s being imported.
Refactoring planning
Refactoring planning
Before moving or removing a file, understand all the import paths that lead to it.
Bundle size investigation
Bundle size investigation
Identify why a heavy dependency is being included in your bundle.
Circular dependency debugging
Circular dependency debugging
Use with
--all to see all paths between files involved in circular dependencies.Related Commands
- imported-by - List files that directly import a target file
- files - List all files in an entry point’s dependency tree
- circular - Detect circular dependencies
