Answer the question
In order to leave comments, you need to log in
How to put a task in the gulpfile.js file so that it runs after the main tasks?
there is a task in the gulpfile.js file that is responsible for collecting the project and deploying it to production, but the deployment itself does not work the first time, as I understand it, because the styles have not yet been compiled. Actually the question is: how to properly issue an ftp task so that it runs after the main tasks?
the task itself looks like this:
gulp.task('prod', ['cleanProd', 'sprite'], function () {
gulp.start('buildProd', 'jsMap:buildProd', 'jsLibs:buildProd', 'webserverProd' , 'ftp');
});
that is, how to perform tasks before the main ones I found, but how not after!
Answer the question
In order to leave comments, you need to log in
I used it both as a run-sequence plugin and as a task launch after the main task like
gulp.task('allftp', ['css:buildProd'], function(callback) {
gulp.start('ftp');
});
as a result, the tasks, judging by the console, are executed in the correct sequence, but the styles are eventually deployed anyway old (at least the first time, the second time they are already deployed with changes), that is, you still have to restart the task a second time.
So the question is still relevant)
So far, I solved it by manually setting the delay -
gulp.task('ftp', ['css:buildProd'], function (cb) {
setTimeout(function () {
gulp.start('ftp-task')
cb();
}, 5000);
});
very easy to google because
stackoverflow.com/questions/22824546/how-to-run-gu...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question