How to understand this sentence: Are your tasks running before the dependencies are complete? Make sure your dependency tasks are correctly using the async run hints: take in a callback or return a promise or event stream.
Translation of gulpjs Chinese website: Is your task running before the tasks of these pre-dependencies are completed? Please make sure that the tasks in the task list you depend on use the correct asynchronous execution method: use a callback, or return a promise or stream.
I'm a little confused. If callback is not used or promise/stream is returned, then this task is not an asynchronous task?
There is also gulp.task('mytask',['beforemytask']), which means that beforemytask is executed before mytask is executed, which is a bit synchronous, but beforemytask needs to use the correct asynchronous method?
Confused, please ask God to clarify my doubts
Yes. Gulp task sequence execution relies on Orchestrator, which will determine whether the function has parameters (callback) and return value (promise/stream) to determine whether it is asynchronous.
You need to detect the end of beforemytask and use the above method to ensure that mytask is executed later. Otherwise, any method will do.
It must be handled according to the dependency relationship. I use synchronization to understand it here. I think there is no problem. This is my understanding, for reference only
Here’s an example