我在gruntfile.js
:
coffee: {
glob_to_multiple: {
expand: true,
flatten: false,
cwd: 'server/api',
src: ['**/*.coffee'],
dest: 'server/api',
ext: '.js',
extDot: 'last'
}
}
我想添加另一个目录,例如cwd: 'server/config'
和目的地应分别为dest: 'server/config'
。如何实现?
答案 0 :(得分:1)
定义另一个咖啡子任务:
coffee: {
glob_to_multiple: {
expand: true,
flatten: false,
cwd: 'server/api',
src: ['**/*.coffee'],
dest: 'server/api',
ext: '.js',
extDot: 'last'
},
other_stuff: {
expand: true,
flatten: false,
cwd: 'server/config',
src: ['**/*.coffee'],
dest: 'server/api',
ext: '.js',
extDot: 'last'
}
}
grunt coffee
会执行这两项任务,grunt coffee:glob_to_multiple
只会运行第一项任务。