privatenumber / tsx

⚡️ TypeScript Execute | The easiest way to run TypeScript in Node.js
https://tsx.is
MIT License
8.64k stars 132 forks source link

fix: support TS resolution in JS files when `allowJs` is set #535

Closed nwalters512 closed 2 months ago

nwalters512 commented 2 months ago

Closes #135.

I tested this locally and it works as expected in my project. I also added a new test which fails on develop but passes after these changes.

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tsx ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 25, 2024 10:01am
privatenumber commented 2 months ago

Really appreciate this PR, thanks @nwalters512 !

BTW I had a vision to leverage get-tsconfig like this https://github.com/esbuild-kit/cjs-loader/pull/34/files but I think there are other problems with that approach and this is a good solution for now. 🙌

nwalters512 commented 2 months ago

And thank you for maintaining this excellent package! It's been a breath of fresh air after ts-node. Looking forward to seeing this land 🎉

privatenumber commented 2 months ago

:tada: This issue has been resolved in v4.7.3

If you appreciate this project, please consider supporting this project by sponsoring :heart: :pray: