Created
February 18, 2011 22:21
-
-
Save isaacs/834524 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From dba83be0495566fb065cfed484551bfb5e4155c1 Mon Sep 17 00:00:00 2001 | |
From: isaacs <i@izs.me> | |
Date: Fri, 18 Feb 2011 14:18:38 -0800 | |
Subject: [PATCH] Closes GH-690 node_modules folders should be highest priority | |
--- | |
lib/module.js | 4 ++-- | |
1 files changed, 2 insertions(+), 2 deletions(-) | |
diff --git a/lib/module.js b/lib/module.js | |
index ba0b4f3..a493860 100644 | |
--- a/lib/module.js | |
+++ b/lib/module.js | |
@@ -202,7 +202,7 @@ Module._resolveLookupPaths = function(request, parent) { | |
var start = request.substring(0, 2); | |
if (start !== './' && start !== '..') { | |
var paths = Module._paths; | |
- if (parent) paths = paths.concat(parent.paths); | |
+ if (parent) paths = parent.paths.concat(paths); | |
return [request, paths]; | |
} | |
@@ -211,7 +211,7 @@ Module._resolveLookupPaths = function(request, parent) { | |
// make require('./path/to/foo') work - normally the path is taken | |
// from realpath(__filename) but with eval there is no filename | |
var mainPaths = ['.'].concat(Module._paths); | |
- mainPaths = mainPaths.concat(Module._nodeModulePaths('.')); | |
+ mainPaths = Module._nodeModulePaths('.').concat(mainPaths); | |
return [request, mainPaths]; | |
} | |
-- | |
1.7.2.3 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment