【问题标题】:Grunt-contrib-coffee doesn't write to output file (silently fails without throwing an error)Grunt-contrib-coffee 不写入输出文件(静默失败而不抛出错误)
【发布时间】:2013-08-18 15:42:41
【问题描述】:

我正在使用 grunt-contrib-coffee v.0.7.0 和 grunt v0.4.1。

我在 Gruntfile.coffee 中声明了我的咖啡脚本任务,如下所示:

coffee:
  dev:
    'asd.js': 'asd.coffee'

在同一个目录中,我有 asd.coffee,其中包含

hello = 'hi'

还有空的 asd.js。

当我在终端中运行 grunt coffee 时,它会打印:

Running "coffee:dev" (coffee) task

Done, without errors.

但是没有任何东西被写入 asd.js(或任何地方)。怎么了?我该如何解决这个问题?

【问题讨论】:

    标签: node.js file-io coffeescript gruntjs


    【解决方案1】:

    还要验证 GruntJs 实际在做什么,而不是你总是可以尝试的:

    grunt coffee --verbose
    

    并查看它正在处理哪些文件(如果有)

    【讨论】:

    • 好提示。这本可以为我节省几个小时。 :(
    【解决方案2】:

    改成:

    coffee:
      dev:
        files:
          'asd.js': 'asd.coffee'
    

    【讨论】:

      猜你喜欢
      • 2013-12-28
      • 2018-12-31
      • 1970-01-01
      • 2018-01-11
      • 1970-01-01
      • 2020-03-17
      • 2023-03-27
      • 2015-06-13
      • 2015-02-07
      相关资源
      最近更新 更多