Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

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.

Usage

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');

require('gulp-awaitable-tasks')(gulp);

// 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 
        .pipe(sass())
        .pipe(gulp.dest('./styles'));

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

LICENSE

MIT License

About

Add awaitable tasks for gulp

Resources

Releases

No releases published

Packages

No packages published