Skip to content

Instantly share code, notes, and snippets.

@steel1990
Created July 27, 2015 03:26
Show Gist options
  • Save steel1990/3c24b6dfb62cb30938ab to your computer and use it in GitHub Desktop.
Save steel1990/3c24b6dfb62cb30938ab to your computer and use it in GitHub Desktop.
var list = [{
name: 'base',
src: [],
filename: 'base.js',
dest: []
}];
var createJSTask = function (opt) {
gulp.task(opt.name, function () {
return gulp.src(opts.src)
.pipe(gulp.dest(opts.dest));
});
return 'js-' + opt.name;
};
var createSequenceTask = function (list, taskCreater) {
return list.map(function (opt) {
return createJSTask(opt);
});
};
var deps = createSequenceTask(list, createJSTask);
gulp.task('build-js', deps);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment