When using addRelativeDeclarationExtensions
, the extension should be based on the extension of the output file
#264
Labels
bug
Something isn't working
Environment
[email protected]
node 20.9.0
Reproduction
addRelativeDeclarationExtensions
Describe the bug
When compiling a .ts file to .mjs or .cjs, the declaration for the file should be .d.mts or .d.cts accordingly. Additionally, when the declarations include imports with extensions (required for node16), the extension also needs to match. It should be .js in .d.ts files, .cjs in .d.cts files and .mjs in .d.mts files.
Right now the feature just looks at the input file. Typescript would compile a .mts file to .mjs, but since mlly also allows explicitly defining the output extension, it should use that option as the source of truth here as well.
Additional context
#134
Logs
No response
The text was updated successfully, but these errors were encountered: