unjs / unbuild

๐Ÿ“ฆ An unified javascript build system
MIT License
2.19k stars 84 forks source link

fix: generate stub types of with explicit extension import if pkg type is `module` #371

Closed yshrsmz closed 4 weeks ago

yshrsmz commented 4 months ago

๐Ÿ”— Linked issue

resolve #370

โ“ Type of change

๐Ÿ“š Description

Updated DTS stub generation logic to check its module format so that it can work with ESM package.

I wanted to write test cases for this change, but there seems to be no stub-mode related tests and no idea how to write it ๐Ÿค”

๐Ÿ“ Checklist

yshrsmz commented 4 months ago

@pi0 Hi, sorry to bother you, but could you take a look at this PR? I really need this fix for my project.