我收到了一个grunt设置,其中一个新任务应该执行(grunt.task.run)已经存在的任务。 要执行的任务是异步的,新任务应该等到异步任务完成。
这样做的首选方法是什么?
I received a grunt setup and one of the new tasks should execute (grunt.task.run) already existing task. The task to execute is asynchronous, and the new task should wait until the async task has finished.
What is the preferred way to do this?
最满意答案
grunt已经覆盖了这个,你应该将你的任务声明为异步,并在你的任务中使用done()函数告诉grunt它已经完成了,看看这个repo和这篇文章 ,这对我来说非常有帮助。我首先要处理异步任务。
没有一瞥你的gruntfile,这就是我所能说的,但可以通过grunfile的链接免费更新你的帖子:)
grunt already got this covered, you should declare your task as an async one, and use the done() func in your task to tell grunt that it is done, look at this repo and this article, that have been very helpfull to me when I first had to deal with async tasks.
without a glimpse at your gruntfile, this is all i could say, but fell free to update your post with a link to the grunfile :)
更多推荐
发布评论