YUI Compressor TextMate Bundle Easily compress JavaScript and CSS files right from within TextMate.
Free download.
Requirements
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).
Installation
- Extract the YUI Compressor TextMate Bundle ZIP file.
- Copy the
yuicompressor.jarfile to a location of your choosing. - Double-click
YUI Compressor.tmbundleto install the bundle in TextMate. - Open TextMate, and navigate to the Bundle Editor.
- Select the
Preferences...item from theYUI Compressorbundle, and replace the text/absolute/path/to/yuicompressor.jarwith the actual path to the.jarfile from step 2. Note that this must be an absolute path;~/won’t work.
Usage
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.cssbecomesmy_css_file.min.css.my_js_file.jsbecomesmy_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
.cssor.jswill be silently ignored. - When compressing a JavaScript file, the
--nomungeoption is automatically enabled.
License
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).