3 ms·
this is a moot point as ts-node exist. What's lacking is native esmodule support.
by The_rationalist 5y ago
this is a moot point as ts-node exist. What's lacking is native esmodule support.
- Master_Odin 5y agoNative esmodule loading has been a thing since node 12, almost 3 years ago. You just have to turn on a flag or use the `.mjs` file extension.
- The_rationalist 5y ago.mjs has no typescript equivalent to my knowledge. The alternative is to set type: module in my package.json. doing this broke my Vue.js default projet (no idea why) therefore browser/webpack has better support for import in typescript than ts-node (what is missing, commonjs support? no idea but the user experience was atrocious)
- eyelidlessness 5y agoIt does support ESM, with a --loader[1], but even with its SWC option it’s still significantly slower than the esbuild loader I’m working on. Unfortunately, esbuild isn’t totally compatible with tsc, so it’s not a drop-in replacement without plugins. 1: https://github.com/TypeStrong/ts-node#native-ecmascript-modules https://github.com/TypeStrong/ts-node#native-ecmascript-modu...