D
D
dmytrotus2019-08-12 14:07:49
gulp.js
dmytrotus, 2019-08-12 14:07:49

How to run multiple tasks in a row in Gulp?

Good day to all.
I have Gulpfile.js.
I paste the code.

const gulp = require('gulp');
      concat = require('gulp-concat');
      minify = require('gulp-minify');


gulp.task('concat', function() {
  return gulp.src('./js/*.js')
    .pipe(concat('all.js'))
    .pipe(gulp.dest('./dist/'));
});


gulp.task('minify', async function () {
  gulp.src('./dist/all.js') 
  .pipe(minify())
  .pipe(gulp.dest('./dist/all-min.js'));
});

After command in console gulp concat and gulp minify everything works.
Please tell me how to make it so that just after running gulp, the commands work in turn.
I think how to write a line
like gulp.task('default', ['concat', 'minify'])
But this line does not work

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