Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect work with merge streams plugins #90

Open
tamtakoe opened this issue Apr 8, 2015 · 2 comments
Open

incorrect work with merge streams plugins #90

tamtakoe opened this issue Apr 8, 2015 · 2 comments

Comments

@tamtakoe
Copy link

tamtakoe commented Apr 8, 2015

Windows, node.js v 0.12.2

File structure:

test1
|- script1.js
|- script2.js
|- ...
test2
...
test5

gulpfile.js:

gulp.task('test', function() {
    var streamsArr = [];

    for (var stream, i = 1; i < 5; i++) {
        stream = gulp.src(path.join(__dirname, 'test' + i, '**/*'))
            .pipe(through.obj(function(file, enc, callback) {
                setTimeout(function() {
                    callback(null, file);

                }, Math.ceil(Math.random()*100));
            }))
            .pipe(require('gulp-concat')('script.js'))
            .on('end', (function(i) {
                console.log('end of the stream ' + i);
            }).bind(null, i));

        streamsArr.push(stream);
    }

    require('gulp-merge')(streamsArr) //or stream-series, or merge-stream, etc.
        .pipe(through.obj(function(file, enc, callback){
            console.log('merged stream transform:', path.relative(__dirname, file.path));

            callback(null, file);

        }, function(callback) {
            console.log('merged stream flush');

            callback();
        }))
        .on('end', function() {
            console.log('end of the merged stream');
        });
});

console:

end of the stream 4
end of the stream 3
merged stream transform: test1\script.js
end of the stream 1
merged stream transform: test2\script.js
end of the stream 2

Somehow, part of a stream is lost. Also did not work flush and end event of merged stream.

@insidewhy
Copy link

This looks like: #94

@yocontra
Copy link
Member

Is this still an issue with the latest versions of everything? I think this was fixed in our underlying sourcemap module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants