Feature request: Resolve local path aliases in monorepos

Author: ertrzyiksCreated Feb 3, 2022Updated Dec 31, 2025
Labelsenhancement

First of all, thanks for the amazing tool! I find dependency-cruiser extremely helpful in my work.

Context

Here is an example repo that showcases a feature that is used in the one that I would like to analyze. https://github.com/ertrzyiks/dep-cruiser-ts-monorepo

It is a monorepo and the workspace a has a local path alias

Imports using this path alias are not resolved.

It works only if I add a global tsconfig.json to the root of the project

{
  "compilerOptions": {
    "noEmit": true,
    "baseUrl": ".",
    "paths": {
      "~core/*": ["packages/a/src/this-is-the-core/*"],
    }
  },
  "include": ["./packages"]
}

Expected Behavior

Imports are resolved using the closest tsconfig.json

Current Behavior

The workspace tsconfig.json is ignored

Possible Solution

Considered alternatives

Run dependency cruiser separately on each workspace

Source: sverweij/dependency-cruiser