06 Mar 2011
The plugin scans your
# You can specify remote files using URLs... http://code.jquery.com/jquery-1.5.1.js # ...and local files using regular paths # (relative to the location of the manifest): lib/foo.js bar.js # Blank lines and bash-style comments are also supported
Manifest compilation happens in two phases: first, the plugin downloads and caches any remote scripts specified using URLs. Second, it feeds all of the sources (remote and local) into Google’s Closure Compiler, which concatenates them and minifies everything (and provides excellent services like static type checking to boot). The output from the compiler is a
.js file with the same base name and relative path as the original manifest.
I should point out that there are other useful SBT plugins that do a similar job. For example, I plagiarised extensively from Jon Hoffman’s YUI Compressor plugin and Luke Amdor’s Coffee Script plugin when writing my code. These two particular examples don’t do file combination, though, and that was an important feature for my specific use case.