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

Provide --full-paths option to browerify in third example #56

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions bin/cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var factor = require('../');
var minimist = require('minimist');
var pack = require('browser-pack');
var Transform = require('stream').Transform;
var mkdirp = require('mkdirp');

var argv = minimist(process.argv.slice(2));
if (argv.h || argv.help || argv._.length === 0) {
Expand All @@ -25,7 +26,11 @@ var output = argv.o.length > files.length && argv.o[files.length] !== '-'
;

fr.on('stream', function (bundle) {
var ws = fs.createWriteStream(files[bundle.file]);
bundle.pipe(pack({ raw: true })).pipe(ws);

mkdirp(path.dirname(files[bundle.file]), function(err) {
var ws = fs.createWriteStream(files[bundle.file]);
bundle.pipe(pack({ raw: true })).pipe(ws);
});
});

process.stdin.pipe(fr).pipe(pack({ raw: true })).pipe(output);
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"inherits": "^2.0.1",
"labeled-stream-splicer": "^1.0.0",
"minimist": "~0.2.0",
"mkdirp": "^0.5.0",
"nub": "0.0.0",
"reversepoint": "~0.2.0",
"stream-combiner": "~0.2.1",
Expand Down
2 changes: 1 addition & 1 deletion readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ $ module-deps x.js y.js | factor-bundle \
or factor out an existing bundle already compiled by browserify:

``` sh
$ browserify x.js y.js > bundle.js
$ browserify --full-paths x.js y.js > bundle.js
$ browser-unpack < bundle.js | factor-bundle \
x.js -o bundle/x.js \
y.js -o bundle/y.js \
Expand Down