Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/chapel/node-browserify in…
Browse files Browse the repository at this point in the history
…to chapel
  • Loading branch information
James Halliday committed May 10, 2011
2 parents 888d33d + b203c0f commit c24d858
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion index.js
Expand Up @@ -157,7 +157,15 @@ exports.wrap = function (libname, opts) {
reqs.push(name);

if (lib.dependencies.length) {
var deps = exports.wrap(lib.dependencies, { required : reqs });
var _deps = lib.dependencies.map(function (dep) {
try {
require.resolve(dep);
return dep;
} catch(e) {
return require.resolve(path.dirname(require.resolve(name)) + '/node_modules/' + dep)
}
});
var deps = exports.wrap(_deps, { required : reqs });
reqs.push.apply(reqs, lib.dependencies);
return lib.source + '\n' + deps.source;
}
Expand Down

0 comments on commit c24d858

Please sign in to comment.