Skip to content

Instantly share code, notes, and snippets.

@doug
Last active August 29, 2015 14:06
Show Gist options
  • Save doug/ced219de929027e8252e to your computer and use it in GitHub Desktop.
Save doug/ced219de929027e8252e to your computer and use it in GitHub Desktop.
gulp-concat.js
var through = require('through2')
var File = require('vinyl')
var concat = function(filename, opts) {
var dest = new File({path: filename, contents: through()})
var stream = through.obj(function(file, _, done) {
file.contents
.pipe(dest.contents, {end: false})
.on('end', function() {
done()
})
}, function(done) {
dest.contents.end()
done()
});
stream.push(dest)
return stream
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment