vx impact
vx impact shows the direct dependents of a file before you write a single line. Given a file, it returns every file in the repo that imports it — directly, through a path alias, or through a barrel index.ts that re-exports it.
Run vx init in your repository first to build the dependency snapshot before using vx impact.
Command
vx impact <file>
Pass the file path relative to your repository root.
vx impact src/components/Button.tsx
Output
impact: src/components/Button.tsx
12 file(s) affected:
src/app/page.tsx:14
src/components/Header.tsx:8
src/components/Footer.tsx:22
...
This is the same list as the used by section of vx deps, without the imports.
Why run vx impact before a change
Knowing who depends on a file before editing prevents surprises. A file that looks isolated may be re-exported through a barrel file and consumed across the repo — including in test directories or monorepo packages you wouldn't think to check.
Real example: In Excalidraw, the TypeScript compiler finds 40 files that use packages/common/src/random.ts. Grepping for the file's path finds 1 of them — the rest import it through the @excalidraw/common barrel, which grep can't follow. vx impact packages/common/src/random.ts lists 45 files, including all 40.
Across 20 Excalidraw files checked against the compiler, vx impact found 100% of the real dependents. Grepping for the file path found 57%.
TypeScript Re-Export Chains
vx impact follows barrel files by name. When a barrel re-exports your file, vx impact lists the barrel plus every file that imports one of your file's exports through it — not every file that happens to import the barrel.
impact: packages/element/src/align.ts
4 file(s) affected:
packages/element/src/index.ts:59
packages/excalidraw/actions/actionAlign.tsx:9
packages/excalidraw/tests/data/restore.test.ts:17
packages/excalidraw/tests/renderOverrides.test.tsx:4
Here packages/element/src/index.ts is the barrel. The other three files import align.ts's exports through it. In v1.5.9 this example listed 228 files, because every importer of the barrel was counted.
This is powered by the nyx engine, which records the names on every import and re-export, including export * from, export { foo } from, export { foo as bar } from, export type { … } from, and re-exports split across multiple lines.
When vx can't tell which names a file uses — import * as ns, require(), dynamic import() — it lists that file to be safe. Expect a few extra files rather than missing ones.
Direct dependents only
vx impact lists the files that use your file. It does not follow those files' own dependents. To go one level further, run vx impact on a file from the results.
Snapshot Warnings
If files have changed since the last snapshot was built, vx impact will print a warning:
warning: snapshot is stale (3 file(s) changed) — run 'vx init' to rebuild
If the snapshot was built by an older version of vx, you'll see:
warning: snapshot was built by an older vx and may be inaccurate — run 'vx init' to rebuild
Results are still returned, but rebuilding with vx init ensures full accuracy.
Supported Languages
- Go — resolves via
go.modmodule name - TypeScript / TSX — resolves relative imports, path aliases, and re-export chains
- Python — resolves relative imports