你如何在Jakefile中编译CoffeeScript?

odi*_*ino 6 javascript node.js coffeescript jake

我想创建一个Jakefile,它编译一些CoffeeScripts来安装NodeJS应用程序.

你是怎样做的?

我尝试过:https: //gist.github.com/1241827

但这是一种微弱的方法,绝对不是优雅的.

任何提示?

Jac*_*son 3

我使用过的大约片段:

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')))
Run Code Online (Sandbox Code Playgroud)

..当然假设您已经coffee-script安装了节点模块。

翻译自我的Cakefile