The YUI Compressor Bundle enables easy compression of JavaScript and CSS files using the YUI Compressor, right from within TextMate.
No more faffing about on the command line or within separate apps in order to combine and compress your JavaScript and CSS files for production.
Just select the files you want to process in the TextMate project drawer, hit a shortcut, and you're done.
The YUI Compressor TextMate Bundle requires:
- The Yahoo! YUI Compressor.
- Python version 2.5 or greater (installed as standard on Mac OS 10.5 and above).
- TextMate (obviously).
- Extract the YUI Compressor TextMate Bundle ZIP file.
- Copy the
yuicompressor.jar
file to a location of your choosing. - Double-click
YUI Compressor.tmbundle
to install the bundle in TextMate. - Open TextMate, and navigate to the Bundle Editor.
- Select the
Preferences...
item from theYUI Compressor
bundle, and replace the text/absolute/path/to/yuicompressor.jar
with the actual path to the.jar
file from step 2. Note that this must be an absolute path;~/
won't work.
Select the files you want to compress in the Project Drawer, and execute the command using ⌃⇧Y
(control-shift-Y).
The compressed files share the same root filename, with the addition of .min
before the file extension. For example:
my_css_file.css
becomesmy_css_file.min.css
.my_js_file.js
becomesmy_js_file.min.js
.
It's worth noting that:
- Existing files with the same name will be overwritten without warning.
- Files with an extension other than
.css
or.js
will be silently ignored. - When compressing a JavaScript file, the
--nomunge
option is automatically enabled.
The YUI Compressor TextMate Bundle is made available under a Creative Commons Attribution-Share Alike 3.0 Unported License.
All code specific to the YUI Compressor itself is issued under a BSD license. YUI Compressor extends and implements code from Mozilla's Rhino project, which is issued under the Mozilla Public License (MPL).
The YUI Compressor TextMate Bundle is no longer under active development, but if you have a problem please post a support request.
- Fixed bug whereby file paths with spaces were not being processed.
- Updated bundled YUI Compressor to version 2.4.2.
- Added changelog.
- Implemented a friendlier error message when the user attempts to run the compressor without first selecting any files.