Skip to content

Commit

Permalink
Improve Symlink Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yungsters committed Sep 25, 2015
1 parent 699b614 commit 92dcdb5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/HasteModuleLoader/HasteModuleLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,10 +599,12 @@ Loader.prototype._shouldMock = function(currPath, moduleName) {
return false;
}

var realPath = fs.realpathSync(modulePath);
this._configShouldMockModuleNames[moduleName] = true;
for (var i = 0; i < this._unmockListRegExps.length; i++) {
unmockRegExp = this._unmockListRegExps[i];
if (unmockRegExp.test(modulePath)) {
if (unmockRegExp.test(modulePath) ||
unmockRegExp.test(realPath)) {
return this._configShouldMockModuleNames[moduleName] = false;
}
}
Expand All @@ -614,9 +616,7 @@ Loader.prototype._shouldMock = function(currPath, moduleName) {
}
};

Loader.prototype.constructBoundRequire = function(unresolvedModulePath) {
var modulePath = fs.realpathSync(unresolvedModulePath);

Loader.prototype.constructBoundRequire = function(modulePath) {
var boundModuleRequire =
this.requireModuleOrMock.bind(this, modulePath);

Expand Down

0 comments on commit 92dcdb5

Please sign in to comment.