Answer the question
In order to leave comments, you need to log in
How to perform synchronous function call in GULP?
I did not find a way how to call functions synchronously. I'm currently solving this problem by creating tasks meant only to be used as dependencies and running them through runSequence. This plugin does not allow you to run functions synchronously and, moreover, pass parameters to them. Since the gulpfile will be used by colleagues, I have to write an explanatory comment for each such task, and there are too many of them. The result is a stubborn design.
Actual example:
In the task, files are taken from the source folder using src + pipe, processed and stored in the target folder. After completing the task, you need to display the size of the source and destination folders. I was going to do this with the get-folder-size plugin. As a result, two additional tasks will be required to run this plugin synchronously.
Questions:
1. How is the problem of asynchronous function launch solved globally?
2. What algorithm for solving the problem from the example will be optimal?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question