【发布时间】:2011-09-26 18:12:14
【问题描述】:
我想创建一个 Jakefile 来编译一些 CoffeeScripts 以安装 NodeJS 应用程序。
你是怎么做到的?
我尝试过: https://gist.github.com/1241827
但这是一个弱的方法,绝对不是优雅的。
有什么提示吗?
【问题讨论】:
标签: javascript node.js coffeescript jake
我想创建一个 Jakefile 来编译一些 CoffeeScripts 以安装 NodeJS 应用程序。
你是怎么做到的?
我尝试过: https://gist.github.com/1241827
但这是一个弱的方法,绝对不是优雅的。
有什么提示吗?
【问题讨论】:
标签: javascript node.js coffeescript jake
我用过的大概sn-p:
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。
【讨论】: