build - Gulp task runs much faster without 'return' statement - why is that? -


gulp task formed (without return) runs faster:

gulp.task('less', function () {   gulp.src('./less/**/*.less')    .pipe(less())    .pipe(gulp.dest('./destination')); }); 

than same 1 return:

gulp.task('less', function () {   return gulp.src('./less/**/*.less')    .pipe(less())    .pipe(gulp.dest('./destination')); }); 

so, question gulp task supposed return? why faster without return, while still generates expected files?

after investigation found when return used on gulp task it's not slower @ all, returns correct time took finish task.

it felt faster since without return statement returned result completed instantly, task time looked few ms, actual process continued on background , completed silently.

so, it's safe it's prefferable use return on tasks have gulp.src().


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -