This Question is Possibly Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
1 Replies Last post: Jul 6, 2013 8:41 PM by Andriy Bazanov  
william mckenzie Newbie 4 posts since
Jul 4, 2013
Currently Being Moderated

Jul 6, 2013 3:50 PM

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

Andriy Bazanov Master 4,194 posts since
May 28, 2010
Currently Being Moderated
Jul 6, 2013 8:41 PM in response to: william mckenzie
Re: Watch a generated file

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.

More Like This

  • Retrieving data ...