我有一个 Scalatra 应用程序可以编译 CoffeeScript,使用https://github.com/softprops/coffeescripted-sbt https://github.com/softprops/coffeescripted-sbt,到默认位置,target/scala-2.9.1/resource_managed/main/js
。我想将生成的 JavaScript 放在一个可供我公开使用的文件夹中src/main/webapp/coffee
,但给出的示例默认为“/target/...”
resourceManaged in (Compile, CoffeeKeys.coffee)) <<= (crossTarget in Compile)(_ / "your_preference" / "js")
我的构建.sbt:
seq(coffeeSettings: _*)
// doesn't work
//(resourceManaged in (Compile, CoffeeKeys.coffee)) <<= ("src" / "main" / "webapp" / "coffee")
我将如何引用我希望编译的资产进入内部的路径build.sbt
正确地,如果是src/main/webapp/coffeee
?
添加到您的 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.coffee 将在以下位置提供http://localhost:8080/js/example.js
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)