【问题标题】:How to use watch in gruntjs to assign multiple tasks to multiple files如何在 gruntjs 中使用 watch 将多个任务分配给多个文件
【发布时间】:2023-03-30 01:38:01
【问题描述】:

我正在尝试这样做(伪代码):

watch

files: fileset1 (for example: *.less), fileset2 (for example: *.mustache)
tasks: 'less','rake'

有可能吗?如果有,怎么做?

【问题讨论】:

    标签: javascript node.js rake less gruntjs


    【解决方案1】:

    取自Grunt jQuery example

    watch: {
       files: ['*.less', '*.mustache'],
       tasks: 'less rake'
    }
    

    【讨论】:

    • 它真的在 0.4 中工作吗?试过了 - 似乎不起作用。看起来此配置在每次更改时启动两个任务。
    • 来自他们的示例代码;是的,它有效;我使用了几十种变体。我无法评论 0.4 的行为,因为它尚未发布;当前稳定版本为 0.3.10。
    猜你喜欢
    • 1970-01-01
    • 2017-05-17
    • 1970-01-01
    • 2014-11-29
    • 1970-01-01
    • 1970-01-01
    • 2021-07-05
    • 1970-01-01
    • 2022-01-19
    相关资源
    最近更新 更多