Merge pull request #4974 from yariplus/patch-10

Fix requiring files outside of node_modules
v1.18.x
psychobunny 9 years ago committed by GitHub
commit 6516b70f9a

@ -276,7 +276,8 @@ module.exports = function(Plugins) {
* With npm@3, dependencies can become flattened, and appear at the root level.
* This method resolves these differences if it can.
*/
var atRootLevel = fullPath.match(/node_modules/g).length === 1;
var matches = fullPath.match(/node_modules/g);
var atRootLevel = !matches || matches.length === 1;
try {
fs.statSync(fullPath);
@ -329,4 +330,4 @@ module.exports = function(Plugins) {
}
});
};
};
};

Loading…
Cancel
Save