Skip to content
Ant task for compressing JavaScript and CSS files using YUI compressor
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build/jar
example
src
.gitignore
LICENSE
README.md
build.properties
build.xml

README.md

About ant-yui-compressor

ant-yui-compressor is an Apache Ant task for compressing multiple JavaScript and CSS files using YUI compressor.

Features

  • JS files minification
  • CSS files minification
  • Option to automatically delete original source files after generating minified files
Origins

This project is based on yui-compressor-ant-task by Simon Buckle which only supports JS minification.

Basic Usage

<ant-yui-compressor todir="js">
	<fileset dir="js">
		<include name="backbone.js" />
		<include name="jquery.js" />
	</fileset>
	<mapper type="glob" from="*.js" to="*-min.js"/>
</ant-yui-compressor>

Note: The toDir attribute, as well as fileset & mapper elements are required. The fileset element specifies the list of files to be minified. The mapper elements describes the naming convention for minified files. Both fileset and mapper are standard Ant types and have various configuration options.

Example

A working ant sample project is available with the source code (https://github.com/parambirs/ant-yui-compressor/tree/master/example).

Options

JavaScript

The ant task supports the following attributes for JS files:

Attribute Required? Default
toDir Yes N/A
deleteOriginal No false
linebreak No -1
munge No true
preserveAllSemiColons No false
disableOptimizations No false
verbose No false

CSS

The following options are available for CSS files:

Attribute Required? Default
toDir Yes N/A
deleteOriginal No false
linebreak No -1
[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/e9e0d299aee1cee169c7f8a2361ee89e "githalytics.com")](http://githalytics.com/parambirs/ant-yui-compressor)

Bitdeli Badge

You can’t perform that action at this time.