| ▲ | Cthulhu_ 6 hours ago | ||||||||||||||||||||||
In theory, typescript doesn't need to be transpiled, you can run ts files using `node --experimental-strip-types file.ts` as long as you don't use any code that needs transpilation (like typescript enums). Still need tsx to do type checking | |||||||||||||||||||||||
| ▲ | ivanjermakov 6 hours ago | parent [-] | ||||||||||||||||||||||
No, because of ESM import resolution rules. Typescript suggests extensionless imports, making it incompartible with ESM and therefore Node. Luckly, `node --import=tsx file.ts` handles imports well. This is especially hairy when making a typescript library that is distributed non-compiled (without dist/) and is supposed to run in both browser and Node. | |||||||||||||||||||||||
| |||||||||||||||||||||||