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

Only watch specified directory (--watch CLI param) #787

Open
2 tasks done
ActivistChecklist opened this issue Dec 21, 2024 · 2 comments
Open
2 tasks done

Only watch specified directory (--watch CLI param) #787

ActivistChecklist opened this issue Dec 21, 2024 · 2 comments
Labels
good first issue Good for newcomers

Comments

@ActivistChecklist
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

Allow a directory (or list of directories) to be passed into the --watch param

Motivation

In my project, I have a small API subfolder. When I turn on --watch, it is monitoring my entire project root for changes, which leads to resets constantly.

Example

Right now the only solution is to do something like this:

fastify start --watch --ignore-watch '.git node_modules out .next content public scripts utils styles pages config compontents' --log-level info --pretty-logs --port ${API_PORT:-4321} api/server.js

I would rather do this:

fastify start --watch api --log-level info --pretty-logs --port ${API_PORT:-4321} api/server.js
@mcollina
Copy link
Member

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

@mcollina mcollina added the good first issue Good for newcomers label Dec 23, 2024
@jean-michelet
Copy link
Contributor

jean-michelet commented Dec 23, 2024

Good idea @ActivistChecklist,

Maybe look at the ignore-watch related code to take inspiration and do it the other way.

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

No branches or pull requests

3 participants