Skip to content

Conversation

@Timeless0911
Copy link
Contributor

Summary

If we enable dts.autoExtension, when renaming .d.ts to .d.cts, there may throw error error Failed to rename declaration file foo.d.ts: Error: ENOENT: no such file or directory, rename foo.d.ts -> foo.d.ts or there may only have foo.d.cts due to file conflict.

The best solution is to use the writeFile function of the ts compiler api to directly emit correct filename.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@Timeless0911 Timeless0911 requested a review from fi3ework April 18, 2025 07:07
@Timeless0911 Timeless0911 changed the title fix: rename error when apply bundleless dts filename fix: use \writeFile\ of ts api to rename declaration files Apr 18, 2025
@Timeless0911 Timeless0911 changed the title fix: use \writeFile\ of ts api to rename declaration files fix: use writeFile of ts api to rename declaration files Apr 18, 2025
fi3ework
fi3ework previously approved these changes Apr 18, 2025
@netlify
Copy link

netlify bot commented Apr 18, 2025

Deploy Preview for rslib ready!

Name Link
🔨 Latest commit fdffdcf
🔍 Latest deploy log https://app.netlify.com/sites/rslib/deploys/6802134d170afa0008570098
😎 Deploy Preview https://deploy-preview-933--rslib.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Timeless0911 Timeless0911 merged commit 6e9f930 into main Apr 18, 2025
14 checks passed
@Timeless0911 Timeless0911 deleted the fix/bundleless-dts-rename branch April 18, 2025 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants