mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
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:
@@ -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) {
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user