[RequireNative] Reverse find order to check new modules over old for U2
This commit is contained in:
parent
ee70b23cb4
commit
388736c56c
|
@ -3,4 +3,4 @@
|
||||||
// For Module Updater: get root path for all modules in globalPaths
|
// For Module Updater: get root path for all modules in globalPaths
|
||||||
|
|
||||||
const g = require('module').globalPaths;
|
const g = require('module').globalPaths;
|
||||||
module.exports = (n, e = '') => require(require('path').join(g.find(x => x.includes(n)) ?? g[0], n, e));
|
module.exports = (n, e = '') => require(require('path').join(g.reverse().find(x => x.includes(n)) ?? g[0], n, e));
|
||||||
|
|
Loading…
Reference in New Issue