Jul 30, 2017 · 1 min read
Cool that you asked. You were very close to solving it. The only issue with your code was that you are calling the function genericCopy instead of passing it as a callback. Here’s a what I thought up just now:
gulp.task('html', copy.bind(this, 'srcHTML'));
gulp.task('css', copy.bind(this, 'srcCSS'));
gulp.task('js', copy.bind(this, 'srcJS'));function copy(filetype) {
return gulp.src(paths[filetype]).pipe(gulp.dest(paths.tmp));
}gulp.task('copy', ['html', 'css', 'js']);
Hope you enjoyed the article. :)
