Fix requiring files outside of node_modules

e.g.
```
"scripts": [
        "../../public/vendor/jquery/js/jquery-ui-1.10.4.custom.js"
]
```
This commit is contained in:
Timothy Fike
2016-08-24 17:48:04 -04:00
committed by GitHub
parent f0c4c59793
commit ed3bc06dee

View File

@@ -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) {
}
});
};
};
};