Imported Typescript interface is not being removed from JS output
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 275
- PR merge metrics
- No merged PRs in 30d
Description
Reproduction: https://github.com/steinybot/bug-reports/tree/tsup/imported-ts-interface
`volume.ts`:
```
export interface DirectoryJSON {
[key: string]: string;
}
```
`index.ts`:
```
import {
DirectoryJSON,
} from './volume.js';
export { DirectoryJSON };
```
Outputs:
`index.js`:
```
import {
DirectoryJSON
} from "./volume.js";
export {
DirectoryJSON
};
```
Which blows up when you try and import it as clearly `volume.js` has no export named `DirectoryJSON`.
Contributor guide
Research direction
Start with the linked reproduction at github.com/steinybot/bug-reports/tree/tsup/imported-ts-interface and compare the generated index.js with the TypeScript interfaces in volume.ts and index.ts. Done means the generated JavaScript no longer imports or exports the type-only DirectoryJSON symbol, and importing the output does not fail because volume.js lacks that export.
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
- 35/100