robrich / gulp-if

Conditionally run a task
MIT License
655 stars 26 forks source link

Support multiple streams #38

Closed gevgeny closed 9 years ago

gevgeny commented 10 years ago

It would be great if gulp-resources can pipe multiple streams passed as an array in second and third parameters.

return gulp.src('/assets')
        .pipe(gif('**/*.js', [concat('js/min.js'), uglify()]))
        .pipe(gulp.dest('/dist/js'));
popomore commented 10 years ago

you can use multipipe to combine the two stream

var pipe = require('multipipe');
return gulp.src('/assets')
        .pipe(gif('**/*.js', pipe(concat('js/min.js'), uglify())))
        .pipe(gulp.dest('/dist/js'));
gevgeny commented 10 years ago

Does not work as expected for me.

elado commented 10 years ago

It worked for me perfectly. Thanks!

popomore commented 10 years ago

@gevgeny What do you want?

knpwrs commented 9 years ago

Might I suggest documenting this in README.md? I was about to fork and add multiple pipe support and then I saw that there were some issues open so I went ahead and looked at them.

MarcelRobitaille commented 9 years ago

@popomore Worked for me, thanks! :D

robrich commented 9 years ago

I think using merge-stream is a safer alternative.