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

How can I watch multiple directories? #1076

Closed
vforv opened this issue Jul 28, 2017 · 9 comments
Closed

How can I watch multiple directories? #1076

vforv opened this issue Jul 28, 2017 · 9 comments

Comments

@vforv
Copy link

vforv commented Jul 28, 2017

I need something like this:

[{
  "watch": ["src/api-gateway"],
  "ext": "ts",
  "ignore": ["src/**/*.spec.ts"],
  "exec": "ts-node ./src/api-gateway/main.ts"
},
{
  "watch": ["src/services/ping-service"],
  "ext": "ts",
  "ignore": ["src/**/*.spec.ts"],
  "exec": "ts-node ./src/services/ping-service/ping-service.ts"  
}]

Is that possible?

@nsoseka
Copy link

nsoseka commented Aug 11, 2017

I think if you run nodemon from from a parent directory where you have your file that starts the server it watches changes to all the files in sub directories.
or you could try watch: "src/." and combine all that into one object, samething for the exec prop. Not really sure though.

@ouqinglai
Copy link

@vforv deal with it?

@rhernandog
Copy link

Hello,

Sorry to bring this back, but I'm having some issues with specific watched directories in an express app.

From the docs I have this:

nodemon --watch app --watch libs app/server.js

When I try to run this code nothing happens when something changes in any of the directories being watched:

nodemon --watch build --watch public build/server.js

Basically I want to restart the server whenever there's a change in the server or client code. The server does start but never restarts automatically when a change happens and the bundling process is working fine.

If I run the code without the watch flags, nodemon looks for changes in all the folders and it does works. What I want is to keep track only of those two folders.

@nsoseka
Copy link

nsoseka commented Dec 12, 2017

@rhernandog have you tried out all the solutions above?

@remy
Copy link
Owner

remy commented Dec 18, 2017

@rhernandog can you give this a test with latest nodemon@1.13.3? I think I found this in the code and fixed it (not sure how it broke, but I was able to replicate the issue with a single dir and then this latest build fixes it).

@rhernandog
Copy link

@remy Thanks I'll update the package and let you know how it went.

@remy
Copy link
Owner

remy commented Dec 20, 2017

@rhernandog can you test with nodemon@1.14.0? I've pushed a change that fixes (some) directory watching problems.

@remy
Copy link
Owner

remy commented Dec 22, 2017

This is working in the latest release. Please go ahead and upgrade ❤️

@remy remy closed this as completed Dec 22, 2017
@rhernandog
Copy link

@remy Sorry I couldn't get back before.

Is working great with the latest update, thanks for the great work!!! 👏👏

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

No branches or pull requests

5 participants