Skip to content

Instantly share code, notes, and snippets.

@magsout
Last active August 29, 2015 14:01
Show Gist options
  • Save magsout/8c7e5d910c6c4f09c0d3 to your computer and use it in GitHub Desktop.
Save magsout/8c7e5d910c6c4f09c0d3 to your computer and use it in GitHub Desktop.
var gulp = require('gulp');
// takes in a callback so the engine knows when it'll be done
gulp.task('one', function(cb) {
// do stuff -- async or otherwise
cb(err); // if err is not null and not undefined, the orchestration will stop, and 'two' will not run
});
// identifies a dependent task must be complete before this one begins
gulp.task('two', ['one'], function() {
// task 'one' is done now
});
gulp.task('three', ['two'], function() {
// task 'two' is done now
});
gulp.task('four', ['three'], function() {
// task 'three' is done now
});
@dhoko
Copy link

dhoko commented May 13, 2014

Pas forcément tu peux aussi procéder comme ça :

// Prod all the things !
gulp.task('prod',['env','assets','vendor','templates','scripts','styles','manifest','i18n'], function() {
    gulp.start("zip");
    gulp.start("doc");
});

Ici l'avantage c'est que je peux run mes tâches en parallèle. Par contre Zip et doc ne vont démarrer qu'une fois le set de tâches dans l'array terminé.

@magsout
Copy link
Author

magsout commented May 26, 2014

Par contre tout ce qui est dans l'array va se paralléliser ? Zip et doc vont se paralléliser aussi entre eux ?

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