Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generates empty .d.ts declaration file #762

Closed
IanVS opened this issue Nov 3, 2022 · 1 comment · Fixed by #807
Closed

Generates empty .d.ts declaration file #762

IanVS opened this issue Nov 3, 2022 · 1 comment · Fixed by #807
Labels

Comments

@IanVS
Copy link
Contributor

IanVS commented Nov 3, 2022

Hi! I'm working on some changes in Storybook, and I've come across a problem. I have an entry file that is only performing a function call, without any exports. When I run it through tsup, with the dts option set, I get an empty declaration file. Typescript itself puts export {} in the .d.ts file, so that it is still treated as a module and avoids errors in other modules that import it (for side-effects, for example).

Here's an example typescript playground which shows the .d.ts being created as export {}: https://www.typescriptlang.org/play?target=7&module=1&isolatedModules=true&allowSyntheticDefaultImports=false&ts=4.8.4#code/JYWwDg9gTgLgBGAhjAFnAZlCI4HImq4DcAsAFDnoCuAdgMYzAQ1xQCmA5sAM4xtQAKAJRwA3uThw6zbhAA2bAHRyIHAbgAmEOIjipgNDriGkyAX3Ll2XXv2GmgA

But, when I create such a file with tsup and compile it, I get an empty file.

Please let me know if I can do anything to help troubleshoot or solve this.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2023

🎉 This issue has been resolved in version 6.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

SeanZellmer added a commit to SeanZellmer/tsup that referenced this issue Feb 16, 2023
…e export {} for file that have no exports (#807)

Co-authored-by: EGOIST <[email protected]>
close egoist/tsup#762
close egoist/tsup#791
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant