M
M
MortSith2021-08-11 20:34:52
gulp.js
MortSith, 2021-08-11 20:34:52

How to rewrite this task to the new version of GULP, i.e. without tasks?

gulp.task('less', wrapPipe(function(success, error) {
    return gulp.src('less/*.less')
       .pipe(less().on('error', error))
       .pipe(gulp.dest('app/css'));
  }));
 

function wrapPipe(taskFn) {
  return function(done) {
    var onSuccess = function() {
      done();
    };
    var onError = function(err) {
      done(err);
    }
    var outStream = taskFn(onSuccess, onError);
    if(outStream && typeof outStream.on === 'function') {
      outStream.on('end', onSuccess);
    }
  }
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey delphinpro, 2021-08-11
@delphinpro

The gulp site, of course, you didn't bother to look at https://gulpjs.com/docs/en/getting-started/creatin...
But there is all the necessary information there.

K
Konstantin Velichko, 2014-05-04
@pashulke

Pictures are not displayed because the blocks are empty, they collapsed
Well, I don’t observe these problems
jsfiddle.net/Zoxon/agUX4/1/show

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question