Problem with YUI Compressor
I setup a file watcher for yuicompressor - 2.4.8 and it crashes while trying to minify a css file.
Exception in thread "main" java.lang.reflect.InvocationTargetException
...
Caused by: java.lang.StackOverflowError
Now I did find a stackoverflow question on this at http://stackoverflow.com/questions/8831462/yuicompressor-crashes-stackoverflow-error
it seems that setting -Xss would fix the problem, but how do I set phpstorm to run the filewatcher with the -Xss setting, if I add it to the filewatcher arguments, it just triggers the "Usage: java -jar yuicompressor-2.4.8.jar [options] [input file]" error.
So the question is: How can I set -Xss with a filewatcher in phpstorm?
Please sign in to leave a comment.
To increase the stack size, you need passing -Xss option to java. Default is 512k, try increasing it, for example to -Xss2048k.
To do this, you either need to modify node_modules\yuicompressor\nodejs\cli.js accordingly, by adding args.unshift('-Xss2048k');:
and then specify a path to yuicompressor binary in a Program field of your file watcher (like C:\Users\My.Name\AppData\Roaming\npm\yuicompressor.cmd).
Or, set up your file watcher in a different way, using java as a Program:
Awesome thanks! I used the second way you suggested of setting the filewatcher to run java directly.