这是indexloc提供的服务,不要输入任何密码
Skip to content

watch mode for dts builds doesnt track changes to indirectly referenced imports #833

@foxfirecodes

Description

@foxfirecodes

it looks like tsup doesn't actually watch files that are only imported for their types

this is a huge DX issue when dealing with tRPC, because in order to avoid including a bunch of server-only dependencies in my client package that I'm building, I have to reference & export only the type of my routers, but not the actual router itself

here's a minimal reproduction repro along w a video demonstrating the issue: https://github.com/rayzr522/tsup-watch-type-imports-bug

WindowsTerminal_PDjZjU0aeK.mp4
npm -v
# 8.19.3
pnpm -v
# 7.26.3
tsup -v
# tsup/6.6.0 linux-x64 node-v18.13.0

EDIT: I just realized the bug wasn't exactly what I thought it was, and am having a hard time reproducing the issue in my MVP repo. I will post an update here once I've figured it out, so sorry for the confusion!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions