node-dev
node-dev copied to clipboard
Cannot set config "extension:{ts: 'ts-node/esm'}"
Cannot set config as
extensions: {
...
ts: 'ts-node/esm'
},
If I set it like this, it shows:
Hello?
Looks like you don't have ts-node installed.
Looks like you don't have ts-node installed.
I dont think so...
https://github.com/fgnass/node-dev/blob/9a36a148bc41cd9deb1efd090e4289368db68ad6/lib/wrap.js#L66
↑ this line use require
whether it is MJS or CJS. I wonder whether it is correct. @bjornstar
Feel free to raise a PR with the fix.
I have no ideas 😥
I tried to use import
, but got more errors...
And I've learnt TS/JS for only 0.5 years...
This is actually a duplicate of #242. From ts-node's docs, their ESM loader must passed as a custom loader:
Use any of:
ts-node --esm
ts-node-esm
Set"esm": true
intsconfig.json
node --loader ts-node/esm
NODE_OPTIONS="--loader ts-node/esm" node