我在AngularJS项目中使用grunt-contrib-coffee,并且我尝试根据grunt的目标设置配置选项。我有以下配置文件(使用grunt-load-options):
'use strict';
module.exports = function(grunt) {
return {
stage: {
glob_to_multiple: {
expand: true,
nonull: true,
cwd: 'src/js/',
src: ['*.coffee', 'config/stage.coffee'],
dest: '.tmp/js/',
ext: '.js'
}
}
};
};
但是当我使用grunt coffee:stage
执行任务时,不会复制任何文件。有什么想法吗?
Running "coffee:stage" (coffee) task
>> 0 files created.
Done, without errors.
谢谢!
答案 0 :(得分:1)
grunt-config-coffee
的正确配置需要以coffee
开头,然后,就像您的情况一样,使用特定配置(使用stage
代替glob_to_multiple
) :
module.exports = function(grunt) {
return {
coffee: {
stage: {
expand: true,
nonull: true,
cwd: 'src/js/',
src: ['*.coffee', 'config/stage.coffee'],
dest: '.tmp/js/',
ext: '.js'
}
}
};
};