Replies: 4 comments
-
Up. Having to install |
Beta Was this translation helpful? Give feedback.
-
@cspotcode I'm still happy to create a PR for this if you think it makes sense 😀 I've been using it for months now, and it works well. |
Beta Was this translation helpful? Give feedback.
-
Awesome! Would be nice to have it built in indeed! |
Beta Was this translation helpful? Give feedback.
-
@jraoult Hi, I don't know if that helps but I also have regularly the infinite restart loop when using |
Beta Was this translation helpful? Give feedback.
-
I realise I'm going very niche here. Still, I think the new Node's
--watch
mode is a fantastic opportunity forts-node
to get a watch mode for "free" without the complexity of getting another library involved. You can read about this experimental feature in the official doc if you are not familiar with it.I tried to get it to work with
NODE-OPTIONS='--watch' ts-node --esm --swc
(my combo of choice these days), but it gets into an infinite restart loop. I know the--esm
mode works with 2 processes, so I suspect the first process is dynamically updating a dependency detected by--watch
which ten restarts the whole thing. I tried to debug it but couldn't find a satisfying answer so may be my hypothesis is wrong.I ended up hacking my loader like so:
and I use it with
node --loader myloader.mjs --watch myEntry.ts
It works perfectly so for but having it working out of the box in ts-node would be a better DX.
@cspotcode any idea why it would restart like that? If you guide me, I'm happy to help with a PR.
Beta Was this translation helpful? Give feedback.
All reactions