jgoz/factor-bundle — pull request #2 by jgoz (2014-09-06 17:55:23+00:00)
Title: Expose pipeline for output bundles as param

- can specify ‘pipeline’ param as function that will be executed on pipeline creation
- uses labeled-stream-splicer and has ‘pack’ and ‘wrap’ stages

Example usage with gulp:

```js
var splicer = require('stream-splicer');

function wrap(id) {
return splicer.obj([
source(path.basename(id)),
buffer(),
sourcemaps.init({ loadMaps: true }),
//uglify(),
sourcemaps.write("."),
gulp.dest('./out')
]);
}

gulp.task('default', function () {
var b = browserify([__dirname + '/x.js', __dirname + '/y.js'], { debug: true });
b.plugin(factor, {
pipeline: function (file, pipeline) {
pipeline.get('wrap').push(wrap(file));
}
});

return b.bundle().pipe(wrap('common.js'));
});
```