[RequireNative] Reverse find order to check new modules over old for U2

This commit is contained in:
Ducko 2022-04-07 16:04:05 +01:00
parent ee70b23cb4
commit 388736c56c
1 changed files with 1 additions and 1 deletions

View File

@ -3,4 +3,4 @@
// 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.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));