[RFC]: Pass Node Options in Command Line
Similar to #10 , options like --experimental-loader --experimental-json-modules are very useful too. But I have no space to place them.
Reading ts-node, it seems node options can be passed via NODE_OPTIONS= env.
Sadly not all options can, though I've only had the issue with a very modern one:
NODE_OPTIONS='--env-file=.env' esbuild-dev --watch
node: --env-file= is not allowed in NODE_OPTIONS
Maybe we need an option like --node:--env-file=.env? The syntax is because I only have the same arg parser as esbuild, this new flag can be defined as ["node", list].
There may be a better naming, though.
This option shall works now:
$ esbuild-dev test/index.ts
undefined
$ esbuild-dev --node:--env-file=test/.env test/index.ts
hello