sxzz / tsdown

An even faster bundler powered by Rolldown.
https://jsr.io/@sxzz/tsdown
MIT License
330 stars 7 forks source link

Wrong file extensions #33

Closed RobinTail closed 2 months ago

RobinTail commented 2 months ago

This change broke my build, @sxzz : https://github.com/sxzz/tsdown/commit/1a5c7b5#diff-d74501d769f127f90b8a5b10d33c203821992409d1c2e3867a28548ccb0f2c8f

I'm having "type": "module" in my package.json, and my dist is now having .mjs file containing CommonJS and .js file having ESM.

https://github.com/sxzz/tsdown/blob/1a5c7b5470b7e8ff24a50f8f42d1a79c8bc8598a/src/features/output.ts#L14-L19

The line 19, I belive, should be

return moduleType === 'module' ? 'cjs' : 'js' 

Similar problem with declaration files. Having type: module the files should be .d.ts for ESM and d.cts for CommonJS, but it's .d.ts and .d.mts now

sxzz commented 2 months ago

Try v0.2.13

RobinTail commented 2 months ago

Thank you so much, @sxzz It's fixed!