Setting up YUI watcher

Ok, so last thread I posted got me up and running with a LESS watcher with Node. Now I would like to use YUI for compressing CSS and possibly JS. I have installed YUI via the Node.js console but I can't find where the "program" is for the Watcher.

C:\Users\[user]\AppData\Roaming\npm\

is where the lassc.cmd file is for a LESS watcher but there is no YUI cmd there.

So how does one get a YUI watcher working under Windows?

4 comments

Hi there,

AFAIK, YUI (actual library) and YUICompressor (minifying/optimizing tool) are two different things.

You can get latest version of YUICompressor from https://github.com/yui/yuicompressor/downloads

So ...

  1. Download YUICompressor and extract it somewhere.
  2. When creating YUI Watcher -- just point to the extracted jar file in "Program" field
  3. That's it -- as long as you have java on your system it should work just fine (on Windows PhpStorm/WebStorm will use the one that comes bundled with IDE).


You may use nodejs version of yuicompressor ( https://github.com/yui/yuicompressor ) but:

  • I do not think that it has separate command/file for execution from outside of nodejs
  • it still uses java under the hood

This makes nodejs version of it not really useful for outside-of-nodejs usage.

0

Perfect! Didn't realise it could be a .jar file as well. Great! Hopefully I can now work out the other Watchers when I need them. Love this IDE!

0

Well ... technically it should be

Programm: java.exe
Parameters: -jar path/to/yuicompressor.jar --other_params

But File Watchers plugin is smart enough to accept .jar file in "Program" field and build the correct final command line automatically. This also makes setting up new file watcher entry much easier (especially for those who have never used yuicompressor (and file watcher) before).

0

The help is very misleading:
http://www.jetbrains.com/phpstorm/webhelp/minifying-css.html

It states that if you install everything with npm, the file watcher will automatically fill in the fields.  Well of course that didn't work for me, so I had no idea where to go.  It seemed very strange that the instructions mentioned a .jar file.  Read it for yourself and see if you are just as confused as I am.

So yes, basically ignore all mentions of npm in the help documentation and just download the .jar file.  This also applies to the Google Closure (I use it to compress my js files).

0

Please sign in to leave a comment.