requireNative: fix reversing
This commit is contained in:
parent
7a04cb57df
commit
f2da613f2b
1 changed files with 2 additions and 2 deletions
|
@ -2,5 +2,5 @@
|
|||
// For Updater v2: get direct path in globalPaths (g[0])
|
||||
// For Module Updater: get root path for all modules in globalPaths
|
||||
|
||||
const g = require('module').globalPaths;
|
||||
module.exports = (n, e = '') => require(require('path').join(g.reverse().find(x => x.includes(n)) ?? g[0], n, e));
|
||||
const g = require('module').globalPaths.reverse();
|
||||
module.exports = (n, e = '') => require(require('path').join(g.find(x => x.includes(n)) ?? g[0], n, e));
|
Loading…
Reference in a new issue