Skip to content

Commit

Permalink
Merge branch 'patch_plugin' of https://github.com/alexstrat/node-brow…
Browse files Browse the repository at this point in the history
…serify into alexstrat-patch_plugin
  • Loading branch information
James Halliday committed Apr 30, 2012
2 parents 663b650 + 2914b30 commit 3343be2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions bin/cli.js
Expand Up @@ -2,6 +2,13 @@

var browserify = require('../');
var fs = require('fs');
var resolve = require('resolve');

var rebased_require = function(id) {
var resolved = resolve.sync(id, {basedir : process.cwd()});
return require(resolved);
};


var argv = require('optimist')
.usage('Usage: $0 [entry files] {OPTIONS}')
Expand Down Expand Up @@ -101,11 +108,11 @@ if (argv.ignore) bundle.ignore(argv.ignore);

if (!Array.isArray(args)) args = [ args ];

var fn = require(ps[0]);
var fn = rebased_require(ps[0]);
bundle.use(fn.apply(null, args));
}
else {
bundle.use(require(plugin));
bundle.use(rebased_require(plugin));
}
});

Expand Down

0 comments on commit 3343be2

Please sign in to comment.