Skip to content

[Bug]: dts not generated in monorepo #779

@yf-yang

Description

@yf-yang

Version

System:
    OS: macOS 13.2.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
    Memory: 145.51 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Browsers:
    Chrome: 133.0.6943.98
    Safari: 16.3
  npmPackages:
    @rslib/core: ^0.5.0 => 0.5.0

Details

Based on my observation, that's an issue with tsconfig dependency

There is a monorepo containing two folders tsconfig and pkg. tsconfig is a pure json package (@my/ts-config), it exposes base.json. The root of the monorepo adds @my/ts-config as a dependency.

pkg does not declare @my/ts-config as dependency and pkg/tsconfig.json depends on @my/ts-config/base. tsserver can resolve to the base.json correctly, but rslib can't and dts is not generated.

When copying all the contents from tsconfig/base.json directly to pkg/tsconfig.json, rslib is able to generate the dts files.

Reproduce link

https://github.com/yf-yang/rslib-monorepo-dts-bug

Reproduce Steps

pnpm i
cd pkg
pnpm build

dist/ does not contain dts file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions