2014-02-19 48 views
0

根据this,任务可以是异步的。 就我而言,我有一些任务,每个任务都有几个按顺序运行的子任务(或目标)。Grunt子任务并行运行

例如:

copy: { 
    foo: { 
     // concat task "foo" target options and files go here. 
    }, 
    bar: { 
     // concat task "bar" target options and files go here. 
    } 
    } 

copy:foo时间太长,所以我想拷贝运行的并行子任务。可能吗?

回答

0

是的。使用

setTimeout(your_func1, 0); 
setTimeout(your_func2, 0) 
+0

请问您能更具体吗?什么是'your_func1'? – giokokos

+0

它是没有括号的函数名称,如copy.foo或copy.bar –