等待async grunt任务完成(Wait async grunt task to finish)

编程入门 行业动态 更新时间:2024-10-18 21:23:06
等待async grunt任务完成(Wait async grunt task to finish)

我收到了一个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 :)

更多推荐

本文发布于:2023-08-04 09:59:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1415266.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:grunt   async   Wait   finish   task

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!