-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
pipeline.get('deps') emits invalid data #837
Comments
b.pipeline.get('deps').pipe(through.obj(function (row, enc, next) {
console.log(row);
this.push(row);
next();
})); You won't get an |
Ok, so there's no way for me to use this stream normally as an event emitter, I need to use b.pipeline.get('deps')
.on('data', console.log)
.on('end', function(){ console.log('done!'); }) Is there a way to get functionality like this without installing additional external dependencies? |
You need to also consume the bundle by calling |
I'm sorry if I'm being thick here, but I don't entirely understand. Do you mean "no" is the answer to my last question, and in addition I need to call Is there any chance if you have a moment that you could give a quick example? All I'm really after is a way to grab the dependencies of a project with the least amount of overhead possible. I know you are a busy man, and I really appreciate both your great work on browserify and any time you can spare to help out here 😀 |
Like
or the same thing in code: var through = require('through2');
var b = require('browserify')(__dirname + '/main.js');
b.pipeline.get('deps').push(through.obj(function (row, enc, next) {
console.log(row.file);
this.push(row);
next();
}));
b.bundle(); or you could listen on var through = require('through2');
var b = require('browserify')(__dirname + '/main.js');
b.on('dep', function (row) {
console.log(row.file);
});
b.bundle(); |
Reproduce:
Truncated error message:
Sorry if I'm screwing up the usage here, and would appreciate any corrections. I'm not a streams expert by any means, just used the docs as best I was able to. As a side note, when I listen for the data event on this stream it does emit the correct data, but the stream never emits an end event. I assume these two issues are related somehow.
The text was updated successfully, but these errors were encountered: