mirror of https://github.com/GooseMod/OpenAsar
rewrite: replace requireNative with globalPaths workaround
Added Module.globalPaths workaround (reintroduce native usage instead of our own util using it) is needed as Discord's overlay code depends on their own implementation of this. Also removed requireNative and replace with just require since no longer needed with this hack anyway.pull/140/head
parent
d8035e14b7
commit
8cf5233e94
@ -1,6 +0,0 @@
|
||||
// Custom requireNative as Electron >=17 breaks Module.globalPaths for some reason
|
||||
// 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.reverse();
|
||||
module.exports = (n, e = '') => require(require('path').join(g.find(x => x.includes(n)) ?? g[0], n, e));
|
Loading…
Reference in new issue