Last active
August 29, 2015 14:06
-
-
Save doug/ced219de929027e8252e to your computer and use it in GitHub Desktop.
gulp-concat.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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