browserify / factor-bundle

factor browser-pack bundles into common shared bundles
Other
400 stars 27 forks source link

Is there a recommended way of using this with exorcist? #67

Closed philipwalton closed 9 years ago

philipwalton commented 9 years ago

... or is there a way to get access to the write stream of the output files instead of having them write to disk by default?

geirsagberg commented 9 years ago

I am also interested in a way to keep sourcemaps in separate files.

terinjokes commented 9 years ago

If you use the programatic API, you can pass a function or a stream for the respective "output" options, instead of a filename.

ghost commented 9 years ago

The output arguments are also available to outpipe for command-line usage:

browserify files/*.js \
    -p [ ../ -o 'uglifyjs -cm | gzip > bundle/`basename $FILE`.gz' ] \
    | uglifyjs -cm | gzip > bundle/common.js.gz

https://github.com/substack/factor-bundle#command-line-outpipe-example

cuth commented 9 years ago

I found the factor.pipeline event to be helpful with using exorcist and the API.

b.on('factor.pipeline', function (file, pipeline) {
    pipeline.get('wrap').push(exorcist(path.join('build', path.basename(file) + '.map')));
});