以concat
插件为例,我们可以在 Gruntfile.js 中设置调试和发布目标:
grunt.initConfig({
concat: {
debug: {
},
release: {
},
}
grunt-contrib-watch插件可以有多种配置吗?
这样做时:
watch: {
debug: {
options: {
livereload: true,
nospawn: true
},
copy: {
files: ['js/app/**/*.js', 'js-amd/**/*.js'],
tasks: ['copy']
}
我收到一条错误消息verifying property watch.debug.files exists in config
。
这也不起作用:
watch: {
debug: {
options: {
livereload: true,
nospawn: true
},
files: ['js/app/**/*.js', 'js-amd/**/*.js'],
tasks: ['copy'],
files: ['jade/**/*.jade'],
tasks: ['jade:devmock']
...因为我不能有两个files
-arrays 或两个tasks
-arrays。(它忽略除第一对之外的所有files/tasks
内容)
还有其他方法可以实现我想要的吗?