Esbuild: Node: Support `esbuild/register` hook?

Created on 16 Jul 2020  路  2Comments  路  Source: evanw/esbuild

Hey!

Are you interested in offering an esbuild/register hook, or should I plan on creating my own package for this? (Willing to PR)

The idea is to take the place of these:

$ node -r ts-node/register example.ts
$ node -r esm example

Since esbuild can fill the same role, it would make sense for this to exist. Nearly all ts-node/register use cases are only transpiling (example).

You'll also see this a lot with @babel/register once JSX is involved (example).

Don't recall if esbuild can read a config file, but like the rest of these, the register hook would pick up & apply config to all files.

Thanks!

Most helpful comment

I made https://github.com/egoist/esbuild-register but it requires esm too, btw this seems like a duplicate of #148

All 2 comments

I made https://github.com/egoist/esbuild-register but it requires esm too, btw this seems like a duplicate of #148

Yes, closing as a duplicate of #148. Since ts-node looks kind of complicated, I think it would be good for people to experiment with "register" functionality outside of esbuild core in an independent package.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ayox picture ayox  路  4Comments

a7ul picture a7ul  路  3Comments

mohsen1 picture mohsen1  路  3Comments

elektronik2k5 picture elektronik2k5  路  3Comments

qnp picture qnp  路  4Comments