Using YUI Compressor FileWatcher

How i can use the YUI-Compressor FileWatcher into my projects to minify css and js files?

I have downloaded the actually YUI Compressor jar and setup it into the project-settings -> fileWatchers (see attachment), but nothing happens, if i save a js or css file. The yuicompressor-2.4.7.jar exists under the given path and have execute-rights (Yes, under Linux -> Ubuntu 12.10 with acutally PHPStorm 6).

How it works?

Bildschirmfoto vom 2013-03-25 11:57:11.png
Comment actions Permalink

Hi there,

I'm on Windows ... and it works fine for me:

I'm just always disabling "Immediate file synchronization" option -- I do not need my file(s) to be minified after typing each/single character (I want it to be done when I actually saving the file).

One thing I have to say -- under some circumstances (when I playing with different settings for specific file watcher), some of the active File Watchers may just stop working for no obvious reason -- no reaction at all (such file watcher simply does not run). In this case restarting IDE resolves the issue for me. See if restarting IDE (or whole computer) will help you as well.

and have execute-rights

I'm not Linux expert, but why .jar file would require execute rights? It is not executed directly like .php/.sh/etc file would do.

Yes -- you are pointing to the .jar file in "Program" field of File Watcher .. but the actual/final command executed by IDE is "java -jar path/to/your/file.jar other-parameters-here". My suggestion here -- check that you can run it from your terminal / that java works etc.

Comment actions Permalink

Hi, thanks, i don't know why, but if i uncheck the immediately
compression js / css the filewatcher works and creates the minified versions.


Please sign in to leave a comment.