Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: how can I trigger a respawn if my a dependency changes? #336

Open
SpencerKaiser opened this issue Jun 8, 2023 · 1 comment
Open

Comments

@SpencerKaiser
Copy link

SpencerKaiser commented Jun 8, 2023

Issue description

I'm using a mono repo with multiple packages via Yarn Workspaces

When a dependency package changes (/packages/utils for example), how can I trigger a restart in my core app?

Here's my dev script:

"dev": "ts-node-dev --exit-child --watch .env.local --files --rs --respawn src/index.ts",

If I modify a dependency package, I can see the change trigger in node_modules but my app isn't restarting. I've tried:

  • Adding node_modules to my --watch
  • Modifying my tsconfig
  • Using --debug to see if a file change occurred but was being ignore for some reason

Context

OS version (is it docker or host?), ts-node-dev version
macOS Ventura 13.4 (22F66)
ts-node-dev "^2.0.0"

Did you try to run with ts-node?
N/A

Did you try to run with --files option enabled?
Yes

Did you try to run with --debug option enabled?
Yes

Do you have a repro example (git repo) with simple steps to reproduce your problem?
No but I can create one if needed

@SpencerKaiser
Copy link
Author

So after digging through my debug logs I realized the file I want watched wasn't being added as a watched file... I then realized that was because I was only importing types; is that expected behavior? I suppose that's more of a question for the ts-node team but still

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant