This plugin provides a simple means of utilizing the RequireJS optimizer from within SBT.
Currently, this plugin targets SBT 0.13.
Simply run the package
SBT command to build a new version of the plugin .jar
. Then, set your SBT project's plugins.sbt
to reference/fetch the .jar
.
When the plugin is included in your build, the RequireJS
object comes into scope. Inside that object are the following:
Tasks
runRequireJS
/run-require-js
: Runs the optimizercleanRequireJS
/clean-require-js
: Deletes the output file, if it exists
Settings
projectDir
: The File that represents the directory that is the root of your RequireJS projectoutFile
: The File that represents where you want the RequireJS output file to goshim
: The Option[String] of a path relative toprojectDir
of what RequireJS config file to useoptimize
: The Boolean value that signifies whether or not you want your code run through an optimizer/minifier- If unspecified, this defaults to
true
- If unspecified, this defaults to
This code is released under the Apache 2 license, courtesy of The Guardian. Please see LICENSE.txt for further details.