我想创建一个 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
Node 模块。
翻译自此Cakefile我的。
关于javascript - 你如何在 Jakefile 中编译 CoffeeScript?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7552269/