Currently, I'm in the process of transitioning my tasks to functions while working with v4 gulp. One of the tasks involves implementing a simple clean function that executes a parallel task.
const clean_server = () => del('build/server/*');
const clean_client = () => del('build/client/*');
export function clean(done) {
gulp.parallel(clean_server, clean_client);
done();
}
After following the suggested method from the official documentation, where I call done()
as shown above, although the task starts running, it fails to complete properly.
However, things take a different turn when I make a slight adjustment:
export function clean(done) {
gulp.parallel(clean_server, clean_client)(done);
}
This modification actually works.
With that said, my inquiry revolves around why the initial approach recommended by the documentation doesn't successfully finish the asynchronous task?