Could’t find a plugin for using the YUI Compressor so I wrote one.

The plugin calls the yui-compressor jar file, I’ve used some settings to avoid putting everything on one single line since most text editors grind to a halt when having to deal with long lines.

-jar yuicompressor-2.4.7.jar
--charset utf-8
--line-break 150
-o ${file_base_name}-min.${file_extension}


Use package control and search for YUI Compressor

The source code can be found here:

Gettings started

Make sure you have java installed, then open a .js or .css file and press F7 or command + b.

The plugin generates a new file along side the original with the extension .min.js or .min.css