webpack-cli icon indicating copy to clipboard operation
webpack-cli copied to clipboard

`esbuild-kit/tsx` loader support for TypeScript configuration

Open fregante opened this issue 1 year ago • 9 comments

Feature request

What is the expected behavior?

Webpack could use esbuild-kit/tsx automatically if found, just like it already supports:

  • ts-node/register
  • sucrase/register/ts
  • @babel/register
  • esbuild-register
  • @swc/register

What is motivation or use case for adding/changing the behavior?

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.

How should this be implemented in your opinion?

Is it correct that Webpack uses interpret under the hood to load configuration? If so, I think this change can be followed up in its repo:

  • https://github.com/gulpjs/interpret/issues/95

Are you willing to work on this yourself?

Potentially

Also we need:

  • tsimp support

fregante avatar Aug 01 '23 12:08 fregante

Actually this should probably be moved to webpack-cli:

https://github.com/webpack/webpack-cli/blob/338254e79a9b5007873f3b070c87fc03a98a7c1f/packages/webpack-cli/package.json#L47

fregante avatar Aug 01 '23 12:08 fregante

Yes, we use interpret in webpack-cli.

snitin315 avatar Aug 05 '23 03:08 snitin315

@fregante I think we can provide an option to support loaders that is not supported by interpret, is it fine for you?

alexander-akait avatar Aug 07 '23 16:08 alexander-akait

It seems to me that this already works but I was hoping to see native support since the package is quite popular (more than some existing parsers used by Interpret).

However this stopped working in Node 20. See:

  • https://github.com/webpack/webpack-cli/issues/3889

fregante avatar Aug 07 '23 16:08 fregante

@fregante I think we can send a PR for https://github.com/gulpjs/interpret/issues/95 and ask to merge it, also, yeah, I can modify default loaders array and put this as a temporary workaround until interpret team merge

alexander-akait avatar Aug 07 '23 16:08 alexander-akait

Hey everyone, i'm pretty new here and i'd like to work on this issue

adarsh500 avatar Dec 04 '23 16:12 adarsh500