I have a web application with pure JS frontend and Scala backend. I would like to use Grunt in my build pipeline to process src/main/webapp into target dist/webapp dir with concatenated/minified js and html files, compiled sass sheets etc. I also want to preserve original JS and HTML files for local testing using container:start task, while the package task would build my WAR file with resources processed by Grunt. When I use following setting in SBT:
webappResources in Compile <<= baseDirectory { bd => Seq(bd / "dist" / "webapp") }
then I achieve the second goal - my WAR gets built using the webapp resources in dist/webapp. However, when using container:start during local development I get bound to the same directory. Is there any way to define different dirs for different purposes?
xsbt-web-plugin supports SBT 0.13.1 so you can use the much-nicer syntax to define
webappResources
in theCompile
scope:I might be mistaken, but
webappResources
alone would work, too.or even (unless you want to replace the original value not to append a value):
As for the solution I'd use the following (untested) in
build.sbt
:and leave the default value for the
webappResources
setting for local development.Read Scopes to learn more about "scoping" settings, i.e. setting different values for different axes.