You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Only watch specified directory (--watch CLI param) #787
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
Is this task still active? I noticed a PR has been opened but not reviewed yet. #794
If it's still ongoing, I'd be happy to take it on. @mcollina@jean-michelet
Activity
mcollina commentedon Dec 23, 2024
Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.
jean-michelet commentedon Dec 23, 2024
Good idea @ActivistChecklist,
Maybe look at the ignore-watch related code to take inspiration and do it the other way.
feat: add followWatch parameters to watch mode (fastify#787)
EmilianoBruni commentedon Feb 16, 2025
I've gone crazy with Watch and the problem is the code below that is crazy (and obviously undocumented)
I needed to watch only in "dist". But nothing work. And now I know why. Because fastify add dist by default. But if I ignore ".ts$", voilà 👎
Ok if I don't set anything but I think that if I set ignore-watch I know what folders I want to exclude.
From: https://github.com/fastify/fastify-cli/blob/590f350d1a586f68e78ecc72a8cc1b17ce1507a0/args.js#L7C1-L7C93
gulbaki commentedon Jun 21, 2025
Is this task still active? I noticed a PR has been opened but not reviewed yet. #794
If it's still ongoing, I'd be happy to take it on.
@mcollina @jean-michelet
mcollina commentedon Jun 21, 2025
Yes, I think so! I'm sorry I missed the original PR!
Add CLI option to specify directory or file to watch in watch mode (#…