Created
July 27, 2015 03:26
-
-
Save steel1990/3c24b6dfb62cb30938ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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