相关疑难解决方法(0)

如何同时运行两个grunt监视任务

是否可以同时运行两个监视任务?

我知道我可以在手表设置中拥有任何我想要的任务,只需启动grunt手表,它就会观看所有这些,就像这样

...
watch: {
    A: {
        files: "js/dev/**/*.coffee",
        tasks: ["coffee", "requirejs"]
    },
    B: {
        files: "js/dev/**/*.coffee",
        tasks: ["coffee"]
    },
    C: {
        files: "js/dev/**/*.html",
        tasks: ["copy"]
    }
}
...
Run Code Online (Sandbox Code Playgroud)

......但我不需要这个.我只想拥有不同的开发和生产任务.你可以猜到,A(生产)和B(开发)之间的唯一区别是缩小和连接.我不需要同时启动AB任务.

首先,我提出了这个想法

grunt.registerTask("prod", ["watch:A", "watch:C"]);
grunt.registerTask("dev", ["watch:B", "watch:C"]);
Run Code Online (Sandbox Code Playgroud)

但这没效果.只是第一次观察任务正在运行(C永远不会起作用).这可能做我想要的吗?

gruntjs grunt-contrib-watch

58
推荐指数
4
解决办法
3万
查看次数

标签 统计

grunt-contrib-watch ×1

gruntjs ×1