Watch a generated file

Is it possible to watch the output of a watcher. For instance, I wish to convert .ts files to .js, and then run browserify against the generated .js file into a browser directory. The file watcher I created for browserify seems to work, but it is ignoring generated output (i.e. only works on .js production files). I suppose I could just create my own .cmd file which performed both steps?

thanks,
~Bill

1 comment

Hi there,

The file watcher I created for browserify seems to work, but it is ignoring generated output (i.e. only works on .js production files).

What do you mean here?

I Assume you do use custom scope ("Settings | Scope" and then use it in File Watcher settings) to differentiate between generated .js files and stand-alone .js files ? If not -- maybe this is what you are missing?


Anyway: when you have this sort of "transformation" chain that involves 2 file watchers to work one after another (for example: ".ts --> .js --> .min.js"  ... or  ".less --> .css --> .min.css") where separate watcher is used on each step, the IDE is not always detecting changes on generated file (e.g. .js and .css in the above examples) and therefore 2nd file watcher is not getting fired. In this case manual file system refresh (File | Synchronize) helps as IDE pickups changes and fires "forgotten" file watcher.

On my computer IDE "forgetting" to launch 2nd watcher in a chain in about 80-85% of cases (possibly bacuse of anti-virus ro somewthing -- whatever). For me -- I use only 1 watcher .. and when it's time to deploy (or test with production files) and just run build tool (Phing) that will execute all required steps on all files.

I suppose I could just create my own .cmd file which performed both steps?

Yes -- that would be the safest option.

0

Please sign in to leave a comment.