simonhaenisch/md-to-pdf

Watchmode does only knows initial files.

chamabreu opened this issue ยท 5 comments

Hi,

playing with watch mode, and it seems that it tracks only the files, which are there on the initial call.
If i add later folders or other .md files, they are not tracked.

Should this be like that?
I would like to have a dynamic watch, where I can add files, while watch is running.

I couldnt find any options in chokidar, that would help on this issue - or i didnt saw them :)

Nice package btw...

Hey thanks and let's turn this into a feature request (: I was under the assumption it would work but no idea, this is the only time I ever implemented a watch mode with chokidar, and it's bin a long while since I did that ๐Ÿ˜…

Ok, cool.

I watched already into the source code, maybe I find a solution.

I reviewed this while looking at your PR and yeah it does indeed only watch the file(s) that you pass initially. Changing this is actually not straight-forward because currently it's relying on glob expansion before the file list is passed to the CLI. Not sure it's worth the effort ๐Ÿคท๐Ÿปโ€โ™‚๏ธ (also might end up being a breaking change)

Yes, i understand.

I will develop this feature anyways, because that is a core functionality i am going to need on my server.
I will develop it in my fork, try it to do with less breaking as possible, and maybe you want to merge it then ๐Ÿ˜„