【问题标题】:Update: USER ERROR - TYPO !! grunt-contrib-coffee error finding file & writing to destination更新:用户错误 - 错字!! grunt-contrib-coffee 错误查找文件并写入目标
【发布时间】:2013-12-28 06:58:43
【问题描述】:

在我的 Gruntfile.js 中,我将咖啡任务配置为这样,并且 src/ 目录中存在一个文件 script.coffee

coffee: {
    dist: {
        files: [{
            /* FIX: exapand: true, */
            expand: true,
            cwd: 'src/',
            src: '**/*.coffee',
            dest: 'lib/',
            ext: '.js'
        }]
    }
}

在运行grunt coffee 时,我收到以下错误

Running "coffee:dist" (coffee) task
>> Source file "script.coffee" not found.
>> Destination (lib/) not written because compiled files were empty. 

script.coffee 的内容只是一些测试coffeescript 配置的代码,当我从命令行运行coffee -c script.coffee 时可以完美编译。

script.coffee 备案:

# A bubble sort implementation, sorting the given array in-place.
bubble_sort = (list) ->
  for i in [0...list.length]
    for j in [0...list.length - i] when list[j] > list[j + 1]
      [list[j], list[j+1]] = [list[j + 1], list[j]]
  list


# Test the function.
console.log bubble_sort([3, 2, 1]).join(' ') is '1 2 3'
console.log bubble_sort([9, 2, 7, 0, 1]).join(' ') is '0 1 2 7 9'

我在其他地方有其他项目使用相同的配置...我就是无法解决问题...

有人有什么见解吗?

【问题讨论】:

    标签: javascript node.js coffeescript gruntjs


    【解决方案1】:

    您在files: [{ exapand: true ... }] 中有错字,应该是expand: true

    【讨论】:

      猜你喜欢
      • 2013-08-18
      • 1970-01-01
      • 2013-02-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-13
      • 1970-01-01
      • 2015-06-13
      相关资源
      最近更新 更多