Skip to content

Commit

Permalink
Fixed the case when main is specified as "." or "./" causing the reso…
Browse files Browse the repository at this point in the history
…lve to infinite loop as documented at browserify/browserify#732.
  • Loading branch information
airportyh authored and James Halliday committed Apr 16, 2014
1 parent 2c74b4e commit b11f273
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/async.js
Expand Up @@ -85,6 +85,9 @@ module.exports = function resolve (x, opts, cb) {
}

if (pkg.main) {
if (pkg.main === '.' || pkg.main === './'){
pkg.main = 'index'
}
loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) {
if (err) return cb(err);
if (m) return cb(null, m, pkg);
Expand Down

0 comments on commit b11f273

Please sign in to comment.