【发布时间】:2013-05-13 16:25:39
【问题描述】:
我为 2 个不同的模块配置了一个 grunt 文件。在一项任务中,我可以提供多个来源,并且一切正常。 现在我的要求是为这两个模块提供不同的选项,比如说——我希望两个模块都有不同的 JsHint 规则,并且我希望这两个项目都有单独的缩小文件和一个通用的缩小文件。
Gruntfile.js ->
jshint: {
ac:{
options: {
laxcomma: true, // maybe we should turn this on? Why do we have these
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
onevar: true
},
source: {
src: ['module1/*.js']
}
},
lib:{
options: {
laxcomma: true, // maybe we should turn this on? Why do we have these
curly: true,
eqeqeq: true,
immed: true,
latedef: true
},
source: {
src: ['module2/*.js']
}
}
}
我看到了一些堆栈溢出问题,但我只能找到 Grunt-hub 作为一个选项,我需要创建 2 个单独的文件,然后是一个 grunt hub 文件。我不想这样做,请指导我如何进行?
【问题讨论】:
标签: gruntjs