Ability to extend compilerOptions's paths config · Issue #44589 · microsoft/TypeScript (original) (raw)

Suggestion

I have a tsconfig.base.json file for the monorepo, it defined paths that all project can use

{
  "compileOnSave": false,
  "compilerOptions": {
    ```
    "paths": {
      "@aegis/ui": ["libs/ui/src/index.ts"],
      "@aegis/ui/*": ["libs/ui/src/*"],
      "@aegis/shared": ["libs/shared/src/index.ts"],
      "@aegis/shared/*": ["libs/shared/src/*"]
    }
  },
  "exclude": ["node_modules", "tmp"]
}

Each project has own tsconfig.json, also defined paths that only for itself

{
  "extends": "../../tsconfig.base.json",
  "compilerOptions": {
    "paths": {
      "@environment": ["src/environments/environment.ts"]
    }
  },
  "files": [],
  "include": [],
  "references": [
    {
      "path": "./tsconfig.app.json"
    },
    {
      "path": "./tsconfig.spec.json"
    },
    {
      "path": "./tsconfig.editor.json"
    }
  ]
}

Unfortunately, the paths would be overwritten.

I have to add tsconfig.base.json paths item to each project.

So, it's necessary to provide a solution for this case.

🔍 Search Terms

List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily and help provide feedback.