fix: fix missing ESM type definition file#67
Conversation
JoshuaKGoldberg
left a comment
There was a problem hiding this comment.
Ah, thanks @mizdra!
|
Published in |
|
@JoshuaKGoldberg Thanks for the quick response! However, it seems that dedent.d.mts is not included in the published package. Did you forget to |
|
Ah, no, it's missing in |
|
Oh, I forgot to include it in |
|
Funny how the little old things like that get in the way, right after figuring out the new ESM exports... Fixed in |
|
Has 1.5.1 already been released? It seems not to have arrived at npmjs.com yet. https://www.npmjs.com/package/dedent
|
|
Hmm, try again? Might be a caching thing: https://www.npmjs.com/package/dedent/v/1.5.1 (the publish took suspiciously long on my end...) |
|
Successfully installed. I have confirmed that the problem with the type definition file has also been resolved. Thank you! |


Background
The dedent package exports only CJS type definition files (
./dist/index.d.ts). Therefore, if users try to import dedent as an ESM,tscwill not find the type definition file.How to reproduction:
src/index.ts:This problem can also be detected by publint.
Solution
To solve this problem, I added the ESM type definition file (
./dist/dedent.d.mts).I have also confirmed that this patch allows
tscto pass.