Closed matwilko closed 10 months ago
This is not true. If the source file has a .cjs
extension, TypeScript expects a .d.cts
extension. I tried and this works for all variants of "moduleResolution"
. The change in this PR tells TypeScript that this package has an ESM-only export and can’t be used with CJS.
The only possible reason I can think of you ran into this issue, is that you use a very old version of TypeScript.
Yup, totally right, not sure what was happening here - everything seems to work perfectly fine now, but it was definitely reproducible locally at the time on the latest Typescript, wouldn't have filed otherwise :)
TypeScript always expects type definition files to have the extension
.d.ts
, regardless of the original file extension. Renaming toindex.d.ts
allows the TS compiler to pick up the types :smile: