我无法弄清楚如何使用grunt获取多个文件:
less: {
dist: {
files: {
'<%= yeoman.app %>/styles/main.css': ['<%= yeoman.app %>/styles/main.less']
},
options: {
sourceMap: true,
sourceMapFilename: '<%= yeoman.app %>/styles/main.css.map',
sourceMapBasepath: '<%= yeoman.app %>/',
sourceMapRootpath: '/'
}
}
},
答案 0 :(得分:2)
您必须使用grunt(http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically)的扩展文件语法。例如,要编译所有lib / less / .less来构建/ css / .css:
less: {
dist: {
files: [{
expand: true,
cwd: 'lib/less',
src: ['*.less'],
dest: 'build/css',
ext: '.css'
}]
}
},