如何在Locomotivejs中设置coffescript?

我应该怎么做在Locomotivejs中设置coffeescript。

这似乎很容易,但我无法弄清楚。

我在“all.js”中设置了选项,没有运气。

我想我差不多还是很远才能把事情做好。 🙁

this.set("options",{coffee:true}); 

任何帮助表示赞赏。

您将需要添加一个server.js文件并引导具有CoffeeScript支持的Locomotive,如下所示:

 locomotive = require('locomotive') locomotive.boot('.', 'development', {"coffeeScript": true}, (err, server) -> throw err if (err) server.listen(3000, 'localhost', ()-> addr = this.address() console.log('listening on %s:%d', addr.address, addr.port); ) ) 

启动应用程序:

 $ node server 

有这个拉请求更多的信息: https : //github.com/jaredhanson/locomotive/pull/44

支持lcm命令行的–coffee选项将被添加到即将发布的版本中。