N
N
Nikolay2019-01-07 22:37:21
gulp.js
Nikolay, 2019-01-07 22:37:21

Is it possible to specify a priority when executing a task?

There is such a code.

gulp.task('delImages:build', function() {
  return delFilesDir.sync([paths.img.pay + '**/*', '!' + paths.svg.svgname + '.svg']);
});

gulp.task('image:build', gulp.series(['delImages:build']), function(done) {
  return gulp.src([paths.img.take, '!' + paths.svg.take])
    .pipe(cache(imagemin({
      interlaced 	: true,
      progressive : true,
      svgoPlagins : [{removeViewBox : false}],
      use 				: [pngquant()]
    })))
    .pipe(gulp.dest(paths.img.pay));
    done();
});

I need to make it so that the delImages:build task is executed first and then image:build, but why does it do the opposite (
Before, everything just worked for me!
gulp.task('image:build', ['delImages:build'], function(done) {
  return gulp.src([paths.img.take, '!' + paths.svg.take])
    .pipe(cache(imagemin({
      interlaced 	: true,
      progressive : true,
      svgoPlagins : [{removeViewBox : false}],
      use 				: [pngquant()]
    })))
    .pipe(gulp.dest(paths.img.pay));
    done();
});

gulp.task('delImages:build', function() {
  return delFilesDir.sync([paths.img.pay + '**/*', '!' + paths.svg.svgname + '.svg']);
});

But it doesn't work like that anymore

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question