The YUI Compressor bundle enables easy compression of Javascript and CSS files using the YUI Compressor, from within TextMate.
This bundle should be available to install via the GetBundles bundle. Make sure that you install the correct version as there may be bundles with a similar name by other people. Just check that it's got (by mattkirman) at the end of it.
Simply download a copy of the bundle from http://github.com/mattkirman/YUI-Compressor-tmbundle/downloads and double-click to install into TextMate.
There are 3 steps to getting everything working:
-
Unzip the YUI Compressor and copy the
.jar
file from the to a location of your choosing (make a note of where you saved it). -
Open the
Preferences...
item in this bundle and replace the text/absolute/path/to/yui-compressor.jar
with the actual path to your.jar
file. It must be an absolute path,~/
won't work.
Select the files you want to run through the YUI Compressor in the Project Drawer and execute the command using ⇧⌘Y (cmd-shift-Y)
The compressed files share the same path as the original files, with the addition of .min
before the file extension. For example:
my_js_file.js
becomesmy_js_file.min.js
my_css_file.css
becomesmy_css_file.min.css
You can compress more than one file at the same time, just select all the files you want to compress in your Project Drawer before hitting Compress
.
Existing files with the same name will be overwritten without warning.
For more information read Help
in the installed bundle.