From ed3bc06dee1b8fa8ce37100c9b7ab3c90a1ecf97 Mon Sep 17 00:00:00 2001 From: Timothy Fike Date: Wed, 24 Aug 2016 17:48:04 -0400 Subject: [PATCH] Fix requiring files outside of node_modules e.g. ``` "scripts": [ "../../public/vendor/jquery/js/jquery-ui-1.10.4.custom.js" ] ``` --- src/plugins/load.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/load.js b/src/plugins/load.js index 99019e371f..8eac293829 100644 --- a/src/plugins/load.js +++ b/src/plugins/load.js @@ -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) { } }); }; -}; \ No newline at end of file +};