我使用的是grunt-contrib-copy,数组中的每个对象都有相同的值。
我如何才能在不需要在每个对象上都输入nonull: true, expand: true, cwd: 'src'的情况下使用它呢?
copy:{
dist:{
files: [
{nonull: true, expand: true, cwd: 'src', src: 'index.html', dest: 'dist'},
{nonull: true, expand: true, cwd: 'src', src: 'eanapi/**', dest: 'dist'},
],
},
},发布于 2016-02-23 21:49:12
// copy files
copy: {
img: {
files: [{
expand: true,
cwd: 'src/img/',
src: [
'foo/*.{png,jpg}',
'foo/*.{png,jpg}',
'foo/*.{png,jpg}',
],
dest: 'img/'
}],
},
},只要您指定了一个目标(或目录并拉入嵌套文件夹),就可以这样做。
EDIT: nonull缺省为true,因此您不必指定它。
https://stackoverflow.com/questions/35579014
复制相似问题