Browse files

async resolve now falls back to 'index.js' if main field in package.j…

…son is incorrect
  • Loading branch information...
1 parent ad3a477 commit 62a572635f21bf1c28360ea5c2238be62736429b @thlorenz thlorenz committed Jul 30, 2013
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/async.js
@@ -88,6 +88,8 @@ module.exports = function resolve (x, opts, cb) {
loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) {
if (err) return cb(err);
if (m) return cb(null, m, pkg);
+ if (!pkg) return loadAsFile(path.join(x, '/index'), pkg, cb);
var dir = path.resolve(x, pkg.main);
loadAsDirectory(dir, pkg, function (err, n, pkg) {
if (err) return cb(err);

0 comments on commit 62a5726

Please sign in to comment.