Plugins You can find out about all the publicly available Grails plugins.

Uglify JS Minified Resources Plugin

1 vote
compile "org.grails.plugins:uglify-js-minified-resources:0.1.1"

 Documentation  Source  Issues


Works with the resources plugin to minify javascript resource using Uglify2.


grails install-plugin uglify-js-minified-resources


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


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.


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