I'm using nodemon with gulp and I have a set of tasks that should be run sequentially on file change.
I'm using gulp's watch and send restart from one of these tasks to nodemon.
All is fine except that in this scenario I don't need nodemon to watch any files, because gulp already does it.
Unfortunately there is no way to turn off watching in nodemon.
Moreover, I cannot even make it watch as little as possible - it always adds something like **/ to the paths I provide.
Of course I can use "ignore" option, but it would be much better to be able to specify that I don't need to watch anything at all.
PS It also would be cool to be able to specify what exactly I want to watch without unexpectedly adding prefixes or enforcing defaults (nodemon is very aggressive on this).
Can you replicate this without using gulp (as its a totally separate
project which does its own thing with nodemon)?
On 2 Mar 2015 18:53, "Dmitry Smolin" [email protected] wrote:
I'm using nodemon with gulp and I have a set of tasks that should be run
sequentially on file change.
I'm using gulp's watch and send restart from one of these tasks to nodemon.
All is fine except that in this scenario I don't need nodemon to watch any
files, because gulp already does it.Unfortunately there is no way to turn off watching in nodemon.
Moreover, I cannot even make it watch as little as possible - it always
adds something like **/ to the paths I provide.
Of course I can use "ignore" option, but it would be much better to be
able to specify that I don't need to watch anything at all.PS It also would be cool to be able to specify what exactly I want to
watch without unexpectedly adding prefixes or enforcing defaults (nodemon
is very aggressive on this).—
Reply to this email directly or view it on GitHub
https://github.com/remy/nodemon/issues/516.
I think I can.
But how I supposed to turn off watching? I just didn't find such an option.
And all my attempts to use options like watch: false
, watch: []
, watch: ''
, watch: ['']
(and so on) have failed.
I traced the sources and found that nodemon uses default dirs to watch on any attempt to provide some kind of "nothing" as an option.
For instance:
*.*
to watch list even if defaults weren't applied (will prevent empty watch list even if previous item will be fixed)Also it looks like this line adds **/
prefix to rules, so you cannot specify some concrete file or directory, it will forcefully become **/somedir
You can now do watch: false
to optionally _not_ watch anything. This is rather specific to your problem, but it was simple to add.
Thanks!
Most helpful comment
You can now do
watch: false
to optionally _not_ watch anything. This is rather specific to your problem, but it was simple to add.