Skip to content

Run task in series more elegantly #241

Description

@karellm

Hi,

I am aware of this method: https://github.com/gulpjs/gulp/blob/master/docs/recipes/running-tasks-in-series.md

Though I don't find it elegant. It requires me to write dummy tasks just for the sake of having them run in series:


gulp.task('clean', function() {
    return gulp.src('public', {read: false})
        .pipe(rimraf());
});

gulp.task('copy', function() {
    return gulp.src('app/assets/**')
        .pipe(gulp.dest('public'));
});

gulp.task('copy-clean', ['clean']);

gulp.task('stylus', function() {
    return gulp.src('app/styles/*.styl')
        .pipe(stylus({use: ['nib']}))
        .pipe(gulp.dest('public/css'));
});

gulp.task('stylus-clean', ['copy-clean']);

gulp.task('dev', ['clean', 'copy-clean', 'stylus-clean']);

Why don't you let us decide wether the dependency array is to be run in series or parallel? It could be an options hash, or even some character before the task:

gulp.task('dev', ['clean', 'copy-clean', 'stylus-clean']);

Activity

  1. karellm commented on Feb 5, 2014

    @karellm
    Author

    Sorry for the duplicate entry #242

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions