Skip to content

timbonicus/uglify-js-minified-resources-grails

 
 

Repository files navigation

This is a Grails plugin which provides minification of javascript resources using Uglify2. It is dependent on the standard Grails Resources Plugin

Background

Due to the fact that the YUI Minified Resources Plugin has been deprecated, I thought it would be useful to create a new javascript minification plugin based on the Uglify2 project.

I made generous use of the coffeescript resources plugin for examples on how to use the Rhino library.

Usage

This plugin is available from the Grails Plugin repository

This plugin should automagically minify your javascript files if it is installed. There is no mandatory configuration required.

This plugin ignores javascript files which have an extension of *.min.js.

By default, bundles are ignored since the individual files are minified before getting bundled. To enable bundling, set the following in Config.groovy:

grails.resources.mappers.uglifyjs.forceBundleMinification = true

To disable javascript variable munging, set the following in Config.groovy:

grails.resources.mappers.uglifyjs.noMunge = true

To get info on compression, turn on info logging in Config.groovy:

log4j = {
    // info 'org.grails.plugin.resource' //all resources info logging
    // info 'org.grails.plugin.resource.minified.js.uglify' // just the uglify info
}

License

UglifyJS is licensed under the BSD license.

About

A Grails resource plugin which provides javascript minification via. Uglify2

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Groovy 100.0%