Skip to content

Instantly share code, notes, and snippets.

@XOP
Created August 31, 2015 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save XOP/ac300f105303912c5306 to your computer and use it in GitHub Desktop.
Save XOP/ac300f105303912c5306 to your computer and use it in GitHub Desktop.
Gulp stream output iterator
//
// function
function iteratePaths(stream, start, finish, paths) {
paths.forEach(function (path) {
stream.pipe(gulp.dest(start + path + finish));
});
return stream;
}
//
// suggested usage
gulp.task('styles', function () {
return iteratePaths(
gulp.src('assets/css/*.scss')
.pipe($.plumber())
.pipe($.scss()),
'public/projects/',
'/css/',
['project_1', 'project_2', '...', 'project_N']
)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment