如何在Jakefile中编译CoffeeScript?

我想创build一个Jakefile来编译一些CoffeeScript来安装NodeJS应用程序。

你是怎样做的?

我试着用: https : //gist.github.com/1241827

但这是一个薄弱的方法,绝对不是优雅的。

任何提示?

我用过的近似代码片段:

var fs = require('fs') var coffee = require('coffee-script') // If you'd like to see compiled code.. // console.log(coffee.compile(fs.readFileSync('coffee.coffee'))) // ..otherwise fs.writeFileSync('output.js', coffee.compile(fs.readFileSync('input.coffee'))) 

假设你安装了coffee-script节点模块,当然。

从我的Cakefile转换而来。