Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose --require and --loader hook from this module. #8

Closed
DylanPiercey opened this issue May 17, 2022 · 4 comments · Fixed by #9
Closed

Expose --require and --loader hook from this module. #8

DylanPiercey opened this issue May 17, 2022 · 4 comments · Fixed by #9
Labels

Comments

@DylanPiercey
Copy link
Contributor

DylanPiercey commented May 17, 2022

Would be great if the require and loader hooks from the other esbuild-kit modules were exposed from this top level one. In some scenarios I wan't to use the main tsx bin, but still the others are handy and it'd be nice if I didn't have to install other modules.

I was thinking it should be as simple as adding a exports to this module that with the import condition would expose the loader and otherwise would expose the require hook such that you could:

node -r tsx
node --loader tsx

as an example of where this is useful:

mocha -r tsx
@privatenumber
Copy link
Owner

🎉 This issue has been resolved in version 3.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@electrovir
Copy link

For any future visitors here: when switching from ts-node/register, use just tsx directly (tsx/register doesn't exist).

@privatenumber
Copy link
Owner

It's also documented here:
https://github.com/esbuild-kit/tsx#nodejs-loader

@electrovir
Copy link

Ah, nice! I was searching for register, which explains why I didn't find it in the docs :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants