RedditPP Mascot

RedditPP

r/typescript • … • u/m50

TypeScript and NodeJS

How is everyone using TS with Node nowadays?

Are you using tsnode in dev and tsc to compile for production, or are you using esbuild, or something else?

One requirement I have is that I need the folder structure to remain the same. Another is that I want to be able to handle graphql schema files.

I wrote my own little build tool using esbuild and have it running on every save and then running the result. Part of the reason for this is a) I have ".graphql" files that I am also converting into js files (just wrapping the contents in gql``), and b) I want the code I'm running on in dev to be exactly the same as what runs in prod, so that I have no prod surprises.

That said, I'm pretty new to TS on serverside, usually only use it browser side, and use PHP serverside, so I'm still figuring it all out.

So I'm curious, how are all of you using TypeScript/NodeJS/GraphQL?

— 0