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

esbuild-kit/tsx support #95

Open
fregante opened this issue Aug 1, 2023 · 3 comments
Open

esbuild-kit/tsx support #95

fregante opened this issue Aug 1, 2023 · 3 comments

Comments

@fregante
Copy link

fregante commented Aug 1, 2023

esbuild-kit/tsx is a popular Node/TypeScript loader based on esbuild.

I'd like to use this loader because it's the most straightforward I found so far, without issues and verbose configuration. I wish this was supported natively in Webpack and it looks like Webpack uses interpret internally to automatically load its config.

This is currently supported via experimental flags, up to Node 18:

cross-env NODE_OPTIONS="--loader tsx" webpack --mode=production

But interpret already supports a number of loaders without any config, as shown by this error message:

[webpack-cli] Unable load './webpack.config.ts'
[webpack-cli] Unable to use specified module loaders for ".ts".
[webpack-cli] Cannot find module 'ts-node/register' from '.'
[webpack-cli] Cannot find module 'sucrase/register/ts' from '.'
[webpack-cli] Cannot find module '@babel/register' from '.'
[webpack-cli] Cannot find module 'esbuild-register/dist/node' from '.'
[webpack-cli] Cannot find module '@swc/register' from '.'
[webpack-cli] Please install one of them

@errorx666
Copy link

I'm adding a bounty of $20 to this issue, to be paid when the feature ships to NPM.

https://gitpay.me/#/task/848

CC @evenstensberg since you have an open PR.

CC @privatenumber - this would add tsx support to over 1000 projects, including webpack

@evenstensberg
Copy link

@phated @errorx666 I've finished the PR for supporting tsx.

@privatenumber
Copy link

privatenumber commented Sep 6, 2024

FYI there's already a PR: #96

Edit: The comment I'm responding to got deleted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

5 participants
@privatenumber @fregante @evenstensberg @errorx666 and others