Skip to content

Allow to specify a custom tsconfig in packages mode for monorepos #2061

@avchugaev

Description

@avchugaev

Search Terms

Monorepo, tsconfig, custom path

Problem

When operating in monorepo mode (multiple packages), each package may contain several tsconfig files.
For instance, Nx generates 3 tsconfig files per TypeScript project:

  • tsconfig.json - base configuration, extends workspace's root tsconfig;
  • tsconfig.lib.json - production code configuration, extends package's tsconfig.json;
  • tsconfig.spec.json - tests configuration, extends package's tsconfig.json.

When one generates documentation for several packages, TypeDoc uses tsconfig.json instead of desired tsconfig.lib.json without ability to override the file name (or location).

Suggested Solution

Allow to override package's tsconfig file name (location) via package.json settings:

{
  "name": "@org/package-a",
  "typedoc": {
    "entryPoint": "./src/index.ts",
    "readmeFile": "./README.md",
    "tsconfig": "./tsconfig.lib.json"
  }
}

So that TypeDoc will be more monorepo-friendly and multi-config-friendly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedContributions are especially encouraged

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions