gulpjs / interpret

A dictionary of file extensions and associated module loaders.
MIT License
259 stars 47 forks source link

`esbuild-kit/tsx` support #95

Open fregante opened 1 year ago

fregante commented 1 year ago

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 commented 1 month ago

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 commented 1 month ago

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

aybanda commented 26 minutes ago

101

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

created PR to meet the requirements checout https://github.com/gulpjs/interpret/pull/101