egoist / egoist/tsup

experimentalDts ignore module augmentation

Open
#1,052 0 comments 7 reactions 1 assignee Claimed by @ocavue View on GitHub
Dominant language
TypeScript
Stars
11.3k
Forks
275
PR merge metrics
No merged PRs in 30d

Description

# Problem
Module augmentation is usefull for declaration merging https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation
When using tsup to generate `.d.ts` using `experimentalDts`, it's ignore module augmentation. Change to `dts` will resolve this problem.

## Version Info
- @microsoft/api-extractor 7.38.3
- tsup 8.0.1
- typescript 5.3.2

## Reproduce
- clone this repo https://github.com/axmad386/repro-tsup-augmentation
- install node_modules (pnpm install)
- build using tsup (pnpm build)
- try to change tsup.config between `dts` and `experimentalDts`

## Expectation
`experimentalDts` should generate module augmentation like `dts` do. This line should be generated on `.d.ts` file
```
declare module "axios" {
interface Axios {
dummy(): string;
}
}

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.