我使用的是grunt contrib咖啡版本0.7.0和grunt版本0.4.1。
我在Gruntfile.coffee中声明了我的咖啡脚本任务,如下所示:
coffee:
dev:
'asd.js': 'asd.coffee'
在同一个目录中,我有一个包含的d.coffee
hello = 'hi'
以及空的asd.js。
当我在终端中运行grunt coffee
时,它会打印:
Running "coffee:dev" (coffee) task
Done, without errors.
但是从来没有任何东西被写到asd.js(或任何地方)。怎么了?我该怎么解决这个问题?
为了验证GruntJs实际上在做什么,你可以尝试:
grunt coffee --verbose
并查看它正在处理哪些文件(如果有的话)
将其更改为:
coffee:
dev:
files:
'asd.js': 'asd.coffee'