更新:用户错误-TYPO!!grunt contrib咖啡错误查找文件&写入目的地

Update: USER ERROR - TYPO !! grunt-contrib-coffee error finding file & writing to destination

本文关键字:错误 amp 目的地 文件 咖啡 用户 -TYPO grunt 更新 contrib 查找      更新时间:2024-06-28

在我的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时,它会完美编译。

脚本。咖啡用于记录:

# 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'

我在其他地方有其他项目使用相同的配置。。。我可以;我想不通这个问题。。。

有人有什么见解吗?

您在files: [{ exapand: true ... }]中有一个拼写错误,应该是expand: true