Skip to content

Instantly share code, notes, and snippets.

@joewright
Last active March 25, 2016 19:18
Show Gist options
  • Save joewright/b2bfccb0ad0a6d9335a0 to your computer and use it in GitHub Desktop.
Save joewright/b2bfccb0ad0a6d9335a0 to your computer and use it in GitHub Desktop.
programmatic gulp task
gulp.task('programmatic-configs', function () {
var foldernames = ['some', 'folder', 'names'];
var tasks = foldernames.map(function (fname) {
var taskname = fname + '-build';
gulp.task(taskname, function (done) {
SOME_CONFIG_NAME = fname;
//sequence will run with alternate config...
runSequence('build', done);
});
return taskname;
});
runSequence.apply({}, tasks);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment