Skip to content

Instantly share code, notes, and snippets.

@razbomi
Created November 16, 2016 23:19
Show Gist options
  • Save razbomi/693f8c24dd69675f1c516157478614c7 to your computer and use it in GitHub Desktop.
Save razbomi/693f8c24dd69675f1c516157478614c7 to your computer and use it in GitHub Desktop.
Gulp pipe function
'use strict';
var gulp = require('gulp');
var through = require('through2');
// https://gulp.readme.io/docs
gulp.task('default', () => {
gulp.src('src/**/*')
.pipe(pipeFunction())
.pipe(gulp.dest('dist'))
});
var pipeFunction = () => {
return through.obj((file, enc, cb) => {
console.log(file.path);
return cb(null, file);
});
}
@federicomichela
Copy link

isn't there a way to access the arguments in pipeFunction without using the through lib?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment