I have a need to write a couple of typescript CLI scripts and be able to run them from npm run xyz. I can’t really use bash scripts for this one as I need some npm packages. What’s the best way of getting this running without messing up how Astro handles typescript files? Like I can’t imagine going and adding tsc as a dependency is a great idea as then I also need to deal with where tsc output is written etc
#Use typescript for npm scripts?
10 messages · Page 1 of 1 (latest)
Would ts-node work for this? I checked and it detects your tsconfig so it will be in sync with that, and again it’s for local dev scripts not for prod
What do people think?
Hmm well ts-node doesn’t support files with .TS extension or seemingly any file extension, truly weird. Kind of stuck now.
You can use ts-node or https://github.com/esbuild-kit/tsx