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

How to emit .d.ts and .d.ts.map files? #663

Closed
facinick opened this issue Oct 6, 2021 · 10 comments · Fixed by #679
Closed

How to emit .d.ts and .d.ts.map files? #663

facinick opened this issue Oct 6, 2021 · 10 comments · Fixed by #679

Comments

@facinick
Copy link

facinick commented Oct 6, 2021

I cannot use ts-loader to generate declaration files with this plugin as that'll cause double type checking.
How can I use this plugin and also have declaration files generated?

@facinick
Copy link
Author

facinick commented Oct 6, 2021

What I understand is this plugin cannot generate .d.ts files, so what is the use case of this plugin? A large library which needs to save time on all the typescript type checking will most likely want to export their types too! This plugin is not useful for libraries where we need to export types as well, but perhaps apps where it's the final product that doesn't need types exported

@piotr-oles
Copy link
Collaborator

We're open for contribution - if you think it's a useful feature, feel free to open a PR :)

@aprilandjan
Copy link

I searched the related issues generate d.ts, seems that many people wants this, and so do I, too.

@piotr-oles
Copy link
Collaborator

🎉 This issue has been resolved in version 6.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@aprilandjan
Copy link

Thanks for your work! I'll try it immediately :)

@PierBJX
Copy link

PierBJX commented Dec 21, 2021

@aprilandjan Did you succeed to make it work?

@piotr-oles
Copy link
Collaborator

🎉 This issue has been resolved in version 7.0.0-alpha.15 🎉

The release is available on:

Your semantic-release bot 📦🚀

@aprilandjan
Copy link

@PierBJX sorry for the late reply. I've accomplish that with the v6.5.0 version of the plugin, with typescript.build set to true and typescript.mode set to write-dts(in a project of webpack v4 and babel-loader) Seems that both of these two options are needed, which is not documented clearly. but, so far, so good.

@PierBJX
Copy link

PierBJX commented Jan 29, 2022

@aprilandjan No problem, I found the answer and I add a comment in the PR ;)

@piotr-oles
Copy link
Collaborator

🎉 This issue has been resolved in version 6.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants