Is it a bad practise to use ts-node in p...
# 💻|contributing
b
Has anybody figured out how to use ts with Garden and sync mode? I was previously using ts-node but the project I’m working on moved to tsc+nodemon and that requires two containers to be up, one for compilation and one for runtime🥲 https://stackoverflow.com/questions/60581617/is-it-a-bad-practise-to-use-ts-node-in-production
c
Have you ever tried swc? We use it at Garden and it's >>fast<< in sync mode. https://swc.rs/
in conjunction with nodemon is not bad
b
Do you have public examples or is this setup in private repos? (For the code sync)
g
i like to use https://tsx.is 🙂
c
Unfortunately it's on a private repo, but the gist is: Our dev script runs a
concurrently
(https://www.npmjs.com/package/concurrently) command that runs: - compilation of ts files with
swc --watch
on the
src
folder -
nodemon
watching the compiled files So whenever we are in sync mode, if we change something in the
src
folder, it gets synced, the
swc
compilation gets triggered and
nodemon
restart the server when the compilation ouputs the
.js
files.