D
D
Damir Gabdrakhimov2017-05-20 22:01:42
gulp.js
Damir Gabdrakhimov, 2017-05-20 22:01:42

Why is 'return' needed when describing tasks in gulpfile.js?

Good afternoon, why do we need 'return' when describing tasks in gulpfile.js, if everything works without it?
For example, in the description of the plugin https://www.npmjs.com/package/gulp-sass/ it says that you need to write with 'return', but in many lessons on YouTube I write without 'return', and it works like that.

gulp.task('sass', function () {
  return gulp.src('./sass/**/*.scss')
    .pipe(sass().on('error', sass.logError))
    .pipe(gulp.dest('./css'));
});

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mary Solar, 2017-05-20
@MaryT

so prettier)

Z
zooks, 2017-05-21
@zooks

For the function in the task to return a value.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question