TypeStrong / fork-ts-checker-webpack-plugin

Webpack plugin that runs typescript type checker on a separate process.
MIT License
1.95k stars 240 forks source link

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

Closed facinick closed 2 years ago

facinick commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

aprilandjan commented 3 years ago

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

piotr-oles commented 2 years ago

:tada: This issue has been resolved in version 6.5.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

aprilandjan commented 2 years ago

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

PierBJX commented 2 years ago

@aprilandjan Did you succeed to make it work?

piotr-oles commented 2 years ago

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

The release is available on:

Your semantic-release bot :package::rocket:

aprilandjan commented 2 years ago

@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 commented 2 years ago

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

piotr-oles commented 2 years ago

:tada: This issue has been resolved in version 6.5.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: