Declaration files imports/exports from non-existing *.js files when outExtension is *.mjs
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 275
- PR merge metrics
- No merged PRs in 30d
Description
If Options are as follows:
```
{
dts: true,
format: [ 'esm' ],
outExtension() {
return {
js: '.mjs'
}
}
}
}
```
The generated *.d.ts files will import/export from non-existant *.js files rather than the existing *.mjs files.
But even that would be weird/wrong, shouldn't it actually import/export from other *.d.ts files, not *.js files which doesn't even contain types?
Contributor guide
Research direction
Reproduce the issue with the shown Options, then trace tsup's declaration-generation path and its outExtension handling. Compare the generated .d.ts imports and exports with the emitted .mjs files, and add or update coverage so the intended declaration references are verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100