【问题标题】:CoffeeScript Compile On Windows With NodeJS使用 NodeJS 在 Windows 上编译 CoffeeScript
【发布时间】:2014-05-31 04:38:57
【问题描述】:

我已经安装了 nodejs,使用 npm 安装了 coffee 并注册了环境变量,现在我准备第一次将我的 CoffeeScript 编译成 JavaScript。

我在c:\MyCoffeeScriptProject\中运行以下命令

coffee --compile --output js/

接下来发生的事情是我得到了交互式窗口,而“js”文件夹中什么也没有。

coffee>

我希望所有.coffee 文件都作为.js 文件编译到“js”文件夹中。

【问题讨论】:

    标签: command-line coffeescript


    【解决方案1】:

    你没有告诉它要编译哪些文件。

    Usage: coffee [options] path/to/script.coffee [args]
    

    在当前目录的末尾附加一个句点。

    coffee --compile --output js/ .
    

    如果你重新排列它会更容易阅读。

    coffee --output js/ --compile .
    

    .中的所有coffee文件编译成js/

    一个常见的使用模式是有一个src 文件夹。

    coffee --output js/ --compile src/
    

    【讨论】:

      【解决方案2】:
      c:/parent>coffee --output output  --compile src 
      

      其中“输出”是空白文件夹,“src”文件夹包含咖啡文件。 在 src 级别执行命令。

      【讨论】:

        猜你喜欢
        • 2013-10-14
        • 1970-01-01
        • 1970-01-01
        • 2011-07-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多