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

resolve ${configDir} in tsconfig paths (files, includes, paths) when emitting DTS files #1347

@3dos

Description

@3dos

Using the latest version 8.5.0 it seems tsup is not yet able to resolve the ${configDir} template variable in tsconfig files resulting in compile errors when issuing DTS files.

I've had no issue building the actual Javascript output but when emitting DTS files, there are TS2307 compiling errors related to paths still read with the template variable unreplaced.

I hacked line 1986 of index.js by adding options.dts.compilerOptions.paths = { '@/*': ['/home/path/to/my/project/src/*'] }; which solves the issue. So I'd be keen to investigate and submit a PR to fix this if this is really a bug or a missing feature.

Edit: after investigating a bit, it seems directly linked to evanw/esbuild#4050

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