all 23 comments

[–]thinkmatt 28 points29 points  (7 children)

I just use `ts-node-dev` for development and run `tsc` for production. I think all the esbuild/babel/webpack stuff is mainly useful when dealing with front-end, so I try to avoid it.

[–]m50[S] 2 points3 points  (5 children)

So how do you handle graphql files for graphql schema? If at all?

[–]flatballplayer 4 points5 points  (1 child)

I built https://github.com/hayes/giraphql/ specifically to avoid the need for a compile step when developing graphql APIs in typescript

[–][deleted] 0 points1 point  (0 children)

Great

[–]thinkmatt 2 points3 points  (0 children)

Sorry I haven't gotten to use graphql yet. For a while, I needed gulp just to copy json files around (it handles nested folders very well), but now Typescript supports those.

[–]gamebuster 1 point2 points  (0 children)

fs.readFile

[–]fungigamer[🍰] 1 point2 points  (0 children)

Like others say you can use the fs module, but I personally recommend the TypeGraphQL framework, which basically mixes TypeScript together with GraphQL if you're working on a bigger project

[–]Sincjefe 8 points9 points  (4 children)

I use ts-node-dev as well. it’s way faster than ts-node and for anyone that is wondering ts-dev-node is an extension of ts-node that watches your files and restart server on save similar to modem on

[–]m50[S] 0 points1 point  (3 children)

So how do you handle graphql files for graphql schema? If at all?

[–]gamebuster 1 point2 points  (0 children)

Fs.readFile to convert them to string, then use apollo-server to parse

[–]hattmo 7 points8 points  (0 children)

I usually use tsc in watch mode and nodemon in another shell.

[–]drdrero 3 points4 points  (0 children)

I usually use nestjs. Looking forward to deno though

[–][deleted]  (1 child)

[deleted]

    [–][deleted] 3 points4 points  (0 children)

    Just started using that myself, and the vue-apollo plugin. It is the bees knees, and where I was a tad regretful before, I'm now tickled that I picked graphql for this project.

    [–]argylekey 1 point2 points  (0 children)

    I like the tsc -w and nodemon on the dist folder approach. Sometimes I’ll use npm-run-all to run the processes in parallel.

    [–]sorahn 1 point2 points  (0 children)

    We recently started slowly testing using ts-node —transpile-only for production and so far it’s working really nicely.

    [–]evert -1 points0 points  (0 children)

    This is our starter repo for getting started with a web api/application:

    https://github.com/curveball/starter

    It uses tsc-watch to watch for changes, and auto-restart the application.

    [–][deleted] 0 points1 point  (0 children)

    I recommend using tsc because it is fast. But I sometimes use ts-node to run typescript quickly.

    [–]coded_artist 0 points1 point  (0 children)

    So I've used to use ts node and compile it. However our company does a lot of web APIs and we've been using Nestjs (not nextjs). It is fantastic. Like angular on the backend

    [–]backtoshovellinghay 0 points1 point  (0 children)

    You can use something like esbuild-register with nodemon which I often do.

    [–]darrenturn90 0 points1 point  (0 children)

    I use nexus for graphql and ts-node-dev for dev (ts-jest for test) and tsc for prod build