Ts-node-dev: Legacy watch mode

Created on 3 Mar 2019  路  10Comments  路  Source: wclr/ts-node-dev

Hi @whitecolor,

I really love your project, it's awesome.

But I am running into a problem setting up ts-node-dev within a Docker container, which is using a mounted driver. In Nodemon documentation, they are having Legacy Watch mode that works very well in this case.

It would be nice if we also have something like this.
馃殌

Most helpful comment

I am using these params for my development process:

ts-node-dev --no-deps --respawn --poll --interval 1000 src/main.ts

The CPU usage is around 1-3% (this number will scale depending on how many files I have) which is a huge improvement 馃殌.

All 10 comments

@pvtri96
There's a pending pull request for that in node-dev repo:
https://github.com/fgnass/node-dev/pull/217

Look like it's abandoned, maybe it's time to split and fork it to not rely on a dead code? @whitecolor

Hi, I've checked the pending pull that @19majkel94 suggested and the solution appears to be the use of --poll as a ts-node parameter, so like this ts-node-dev --poll --respawn --transpileOnly src/app.ts.

@19majkel94 You can make the same pull request here (in lib/index.js), because ts-node-dev is already a fork of node-dev, not a wrapper, as you can see in the code.

@jeremyben
I've opened the PR #58 here in ts-node-dev but it's still waiting for review and merge by @whitecolor 馃槙

I always used ts-node-dev --poll with docker on windows without any problem.

@whitecolor
If you like 30% CPU usage from polling every 100ms - yeah, it works without any problem.
I prefer 3s and 3% CPU usage, especially while working on a slower hardware like an old notebook.

Ok, merged and published it. May test.

Looks like it's working and not consuming tons of CPU time 馃帀 Thanks! 馃挭

@19majkel94
What params do you use to run?

I am using these params for my development process:

ts-node-dev --no-deps --respawn --poll --interval 1000 src/main.ts

The CPU usage is around 1-3% (this number will scale depending on how many files I have) which is a huge improvement 馃殌.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maxpain picture maxpain  路  6Comments

n1ru4l picture n1ru4l  路  3Comments

IAfanasov picture IAfanasov  路  11Comments

Derya picture Derya  路  6Comments

Chnapy picture Chnapy  路  6Comments