来自grunt-contrib-less的example:
less: {
development: {
options: {
paths: ["assets/css"]
},
files: {
"path/to/result.css": "path/to/source.less"
}
},
production: {
options: {
paths: ["assets/css"],
plugins: [
new require('less-plugin-autoprefix')({browsers: ["last 2 versions"]}),
new require('less-plugin-clean-css')(cleanCssOptions)
],
modifyVars: {
imgPath: '"http://mycdn.com/path/to/images"',
bgColor: 'red'
}
},
files: {
"path/to/result.css": "path/to/source.less"
}
}
}
它在字典中为less
提供了两个条目:development
和production
。
我不知道该怎么称呼这些条目,或许像“少任务的子任务”。
$ grunt less development
,但这不起作用。 答案 0 :(得分:1)
grunt less:development