【发布时间】: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