我想用grunt凹槽编译2个单独的文件:
recess: {
dist: {
options: {
compile: true
},
files: {
'path/css/custom.css': ['path/less/custom.less'],
'path/css/animate.css': ['path/less/antimate.less'],
},
},
},
在grunt退出之前,只有第一个文件正在编译。我哪里错了?
答案 0 :(得分:3)
你应该试试这个
recess: {
dist: {
options: {
compile: true
},
files: [
{src: ['path/less/custom.less'], dest: 'path/css/custom.css'},
{src: ['path/less/antimate.less'], dest: 'path/css/animate.css'}
],
}
},
或者您可以启用动态扩展来编译文件夹中的每个.less:
recess: {
dist: {
options: {
compile: true
},
files: [
{
expand: true, // Enable dynamic expansion.
cwd: 'path/to/less', // Src matches are relative to this path.
src: ['*.less'], // Actual pattern(s) to match.
dest: 'path/to/css/', // Destination path prefix.
ext: '.css', // Dest filepaths will have this extension.
},
],
},
},
有关详情,请参阅http://gruntjs.com/configuring-tasks。
答案 1 :(得分:0)
recess: {
dist: {
options: {
compile: true
},
files: {
'dist/combined.css': [
'src/main.css',
'src/component.css'
]
}
}
}