Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 14 commits
  • 4 files changed
  • 0 commit comments
  • 4 contributors
Showing with 13 additions and 6 deletions.
  1. +9 −2 bin/cli.js
  2. +0 −1 builtins/crypto.js
  3. +1 −1 lib/wrap.js
  4. +3 −2 package.json
View
11 bin/cli.js
@@ -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}')
@@ -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));
}
});
View
1 builtins/crypto.js
@@ -1 +0,0 @@
-// todo
View
2 lib/wrap.js
@@ -289,7 +289,7 @@ function makeTarget (file, root) {
return file.slice(base.length);
}
else if (file.match(/\/node_modules\/.+/)) {
- return path.normalize(file.match(/(\/node_modules\/.+)/)[1]);
+ return path.normalize(file.match(/.*(\/node_modules\/.+)/)[1]);
}
else {
throw new Error('Can only load non-root modules'
View
5 package.json
@@ -1,6 +1,6 @@
{
"name" : "browserify",
- "version" : "1.10.8",
+ "version" : "1.10.12",
"description" : "Browser-side require() for js directories and npm modules",
"main" : "index.js",
"bin" : {
@@ -32,7 +32,8 @@
"coffee-script" : "~1.1.1",
"optimist" : "~0.2.6",
"http-browserify" : "~0.1.1",
- "vm-browserify" : "~0.0.0"
+ "vm-browserify" : "~0.0.0",
+ "crypto-browserify": "~0"
},
"devDependencies" : {
"tap" : "0.2.x",

No commit comments for this range

Something went wrong with that request. Please try again.