[How to use watch?] Watch command doesn't work as expected ( ingores inputs ) #22898
ThePlenkov
started this conversation in
General
Replies: 1 comment
-
i came across this as well, expected the watch command to watch the files specified as inputs since the files that would invalidate the cache should be the same ones that would require a rebuilt. It seems like it doesn't even respect the sourceRoot defined. From what i can tell it seems like its hardcoded to just watch all files in the folder that the project.json is in. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! Didn't get any reaction on my post in Discord community so duplicating it here.
I am evaluating watch command. As a use case I have set up a small project to generate plantuml diagrams from puml files on the fly.
For that purpose I have defined
puml
accepting only *.puml files as input!{workspaceRoot}/**/*
and puml task as a dependencynx watch --verbose --all -- npx nx build \\$NX_PROJECT_NAME
What I expect from this script to do - I expect that watch command will watch for all files ( i don't mind ), but it will execute targets respecting their named inputs.
Unfortunately it doesn`t happen. Whenever I do anything, like creating a new file - it just runs build again and again. In a case when I use a command to build other files ( such as diagram images ) - it just runs this command many many times.
Indeed something is wrong and I'm trying to understand what - is my config bad or nx doesn't support this functionality yet.
Could you please have a look. You can just run npm run dev in my project to test it. Just try to do anything, like creation if new file, you will see that watch command fill still try to build images for every single change ignoring inputs. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions