首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为CoffeeScript声明不同的编译路径

为CoffeeScript声明不同的编译路径
EN

Stack Overflow用户
提问于 2012-11-28 08:01:18
回答 1查看 378关注 0票数 2

我有一个Scalatra应用程序,它使用https://github.com/softprops/coffeescripted-sbt将CoffeeScript编译到默认位置target/scala-2.9.1/resource_managed/main/js。我想将生成的javascripts放在某个对我公开可用的地方,放在一个名为src/main/webapp/coffee的文件夹中,但给出的示例缺省为`/target/...‘

代码语言:javascript
复制
resourceManaged in (Compile, CoffeeKeys.coffee)) <<= (crossTarget in Compile)(_ / "your_preference" / "js")

我的build.sbt:

代码语言:javascript
复制
seq(coffeeSettings: _*)

// doesn't work
//(resourceManaged in (Compile, CoffeeKeys.coffee)) <<= ("src" / "main" / "webapp" / "coffee")

如果是src/main/webapp/coffeee,我如何在build.sbt中正确引用我想要编译的资源进入的路径

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-11-28 15:26:52

添加到您的build.sbt:

代码语言:javascript
复制
//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上提供。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13595453

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档