我有一个Scalatra应用程序,它使用https://github.com/softprops/coffeescripted-sbt将CoffeeScript编译到默认位置target/scala-2.9.1/resource_managed/main/js。我想将生成的javascripts放在某个对我公开可用的地方,放在一个名为src/main/webapp/coffee的文件夹中,但给出的示例缺省为`/target/...‘
resourceManaged in (Compile, CoffeeKeys.coffee)) <<= (crossTarget in Compile)(_ / "your_preference" / "js")我的build.sbt:
seq(coffeeSettings: _*)
// doesn't work
//(resourceManaged in (Compile, CoffeeKeys.coffee)) <<= ("src" / "main" / "webapp" / "coffee")如果是src/main/webapp/coffeee,我如何在build.sbt中正确引用我想要编译的资源进入的路径
发布于 2012-11-28 15:26:52
添加到您的build.sbt:
//compiles your CoffeeScript files to resource_managed/main/webapp/js/
(resourceManaged in (Compile, CoffeeKeys.coffee)) <<= (resourceManaged in Compile)(_ / "webapp" / "js")
//makes ALL files in resource_managed/main/webapp as static file available
com.github.siasia.PluginKeys.webappResources in Compile <+= (resourceManaged in Compile)(_ / "webapp" )src/main/coffee/example.cafe将在http://localhost:8080/js/example.js上提供。
https://stackoverflow.com/questions/13595453
复制相似问题