Add awaitable tasks for gulp
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Gulp awaitable tasks

NPM version

Runs a sequence of gulp steps within tasks synchronously. This function is designed to solve the situation where want to order your steps within a task.


First, install gulp-awaitable-tasks as a development dependency:

npm install --save-dev gulp-awaitable-tasks 

Then add use it in your gulpfile, like so (note these are only examples, please check the documentation for your functions for the correct way to use them):

var gulp = require('gulp');
var sass = require('gulp-sass');
var cssmin = require('gulp-cssmin');


// This will run steps in compile-css synchronously
// * compile all scss files to css files
// * wait for scss compiling to complete
// * minify all generated css files
// * callback and notify gulp that we are done
 gulp.task('compile-css', function*() {
//                        ^^^^^^^^^^
//                        This is a generator function
    yield gulp.src('./scss/**/*.scss',  { base: "./" })
//  ^^^^^
//  use *yield* keyword to await a stream or promise step 

    yield gulp.src('./styles/**/*.css',  { base: "./" })


MIT License