Skip to content

[Bug]: DTS generate incorrect output when using tsconfig.json#paths #406

@chenjiahan

Description

@chenjiahan

Version

Rslib 0.0.16

Details

  • tsconfig.json:
{
  "extends": "@rsbuild/config/tsconfig",
  "compilerOptions": {
    "outDir": "./dist",
    "baseUrl": "./",
    "rootDir": "src",
    "declarationDir": "./dist-types",
    "composite": true,
    "isolatedDeclarations": true,
    "types": ["@rspack/core/module"],
    "paths": {
      "html-rspack-plugin": ["./compiled/html-rspack-plugin"]
    }
  },
  "include": ["src"]
}
  • tsc output:

Image

  • Rslib output:

Image

Reproduce link

https://github.com/web-infra-dev/rsbuild/tree/rslib_repro_types_1111

Reproduce Steps

  1. pnpm i
  2. cd pacakges/core
  3. pnpm run build
  4. see packages/core/dist-types/types/thirdParty.d.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions