frontlinesms / grails-yui-war-minify-plugin

Grails plugin to run yui-compressor on css and javascript resources at WAR creation time.
3 stars 3 forks source link

Grails YUI War Minify Plugin

Grails plugin to run yui-compressor on css and javascript resources at WAR creation time.

Usage

Add the following to the plugins closure in BuildConfig.groovy:

build ':yui-war-minify:1.5'

Notes

Minification will only occur on war creation. Advantages of this over yui-minify-resources-plugin:

YUI Compressor Settings

CSS

// enable/disable CSS minification
grails.build.yuiminify.css.enabled = true

// line break after the specified column number 
// or 0 to force line break after each semi-colon
grails.build.yuiminify.css.lineBreak = 8000

// exclude CSS files from minification
// comma-separated list; allows wildcards; always excludes '**/*.min.css' even if no option specified
grails.build.yuiminify.css.excludes

Javascript

// enable/disable JavaScript minification
grails.build.yuiminify.js.enabled = true

// line break after the specified column number
// or 0 to force line break after each semi-colon
grails.build.yuiminify.js.lineBreak = 8000

// obfuscate local symbols
grails.build.yuiminify.js.munge = true

// preserve unnecessary semicolons
grails.build.yuiminify.js.preserveSemiColons = true

// enable/disable micro optimizations
grails.build.yuiminify.js.optimizations = true

// exclude javascript files from minification
// comma-separated list; allows wildcards; always excludes '**/*.min.js' even if no option specified
grails.build.yuiminify.js.excludes

TODO