Apache Rave uses wro4j, specifically the wro4j-maven-plugin, to optimize JavaScript. At build time it uses Google Closure Compiler to concatenate and minify all of the individual Rave javascript files into one file called rave_all.min.js

All of the original JavaScript files, along with the minified version, are bundled into the WAR. During run-time Rave uses a Portal Preference to determine if it should serve out the individual source files, or the single optimized file. By default, for ease of debugging, Rave serves out the individual scripts. Rave admins can change the Portal Preference, called javaScriptDebugMode, to "Disabled" if they want to serve out the optimized file (recommended for production installations).

Like all other Portal Preferences, changes are effective immediately, making it useful when you need to debug an issue in a production environment.

Settings

Out-of-the box Rave has configured wro4j to use Google Closure Compiler with SIMPLE_OPTIMIZATIONS. If you would like to change the JavaScript Processor to use ADVANCED_OPTIMIZATIONS, or another library all-together (such as YUI Compressor), you can overlay the wro.properties file located in rave-portal-resources and modify the postProcessors. See the wro4j website for more information.

Future Enhancements

wro4j supports a wide variety of JavaScript and CSS related optimization libraries. As we continue to improve Rave we will look into expanding its use to CSS as well.