使用 Grunt 我想将来自不同动态源的 .less 文件编译为给定路径的单个 .css 目标文件。例如,我的源文件是这样组织的:
app
|_ modules
|_ module1
| |_ branding
| |_ brand1
| | |_ file1.less
| | |_ file2.less
| |_ brand2
| |_ file1.less
| |_ file2.less
|_ module2
|_ branding
|_ brand1
| |_ file1.less
|_ brand2
|_ file1.less
我想在如下目的地编译它们:
app
|_ styles
|_ branding
|_ brand1.css
|_ brand2.css
目前,我正在尝试如下的 grunt 任务定义:
less:{
branding: {
files: [
{
expand: true,
cwd: "<%= yeoman.app %>/app/modules/",
src: ["**/branding/**/*.less"],
dest: "<%= yeoman.app %>/app/styles/branding/",
ext: ".css"
}
]
}
}
这显然不起作用,因为它复制了源代码树。
可能吗?