sbt-web plugin which integrates with Google’s Closure Compiler.
Add the plugin to your project/plugins.sbt
:
addSbtPlugin("net.ground5hark.sbt" % "sbt-closure" % "0.1.4")
Add the Sonatype releases resolver:
resolvers += Resolver.sonatypeRepo("releases")
Enable the sbt-web plugin for your project:
lazy val root = (project in file(".")).enablePlugins(SbtWeb)
Add the closure
task to your asset pipeline in your build.sbt
:
pipelineStages := Seq(closure)Option Description suffix Suffix to append to each file compiled by closure. Defaults to
".min.js"
flags List of command line flags to provide to the closure compiler. Must be in the format of --option-name=value
or --option-flag
parentDir Parent directory name where closure compiled JS will go. Defaults to "closure-compiler"
An example of providing options is below:
Closure.suffix := ".min.js" Closure.flags := Seq("--formatting=PRETTY_PRINT", "--accept_const_keyword")
This will produce assets with the specified Closure.suffix
suffix value under the Closure.parentDir
directory within the target
folder. This will be target/web/public/main
or target/web/stage
. For a full list of closure compiler options, see the official documentation page. You can also specify includeFilter in closure
or excludeFilter in closure
to select files on a custom criteria.
This code is licensed under the MIT License.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4