This is probably a very basic thing, but I just can't get it to work. To the spray-template project I have added the sbt-js plugin.
When I run the js
command it finds and processes my js files in src/main/[resources]/web/js/
and places them in target/scala-2.11/resource_managed/[main]/resources/web/js/
(The [ ] marks directories that shows up as resource directories in intellij).
I try to serve up the js files something like this, but it only works for the unprocessed file:
trait JsContent extends HttpService {
val jsRoute = path("js1") {
getFromResource("web/js/test.js") // The unprocessed js file loads fine.
} ~ path("js2") {
getFromResource("resources/web/js/test.js") // How do I locate the generated file?
}
}
The directory containing the processed files is listed when doing show resourceDirectories
in sbt console, but they are not included in the jar produced when running package.
So how to point out to sbt that I want to use the managed js resources?