Include minified JavaScript files in war

301 views Asked by At

I'm using sbt-js 0.3 to build a Scalatra web project. I've included the following lines in build.sbt.

(webappResources in Compile) <+= (resourceManaged in Compile)

(resourceGenerators in Compile) <+= (JsKeys.js in Compile)

(compile in Compile) <<= compile in Compile dependsOn (JsKeys.js in Compile)

When I run compile the minified files do get generated in the target/scala_2.9.1 folder. But I can't get these files in the war when I use package (from xsbt-web-plugin) or assembly (from sbt-assembly). Any ideas?

1

There are 1 answers

0
Brian Smith On

Looking at xsbt-web-plugin it seems by default to copy from sourceDirectory/webapp and assemble everything in target/webapp.

I think you need to massage your WAR as shown here (except do a copy not a delete) or re-configure to include your minified JS in the webappResources setting.