fix: pass module resolution paths to wrapped function (#25891)
This commit is contained in:
parent
9b43935b07
commit
dfbb88c5f6
1 changed files with 2 additions and 2 deletions
|
@ -43,10 +43,10 @@ if (process.type === 'renderer') {
|
||||||
}
|
}
|
||||||
|
|
||||||
const originalResolveFilename = Module._resolveFilename;
|
const originalResolveFilename = Module._resolveFilename;
|
||||||
Module._resolveFilename = function (request: string, parent: NodeModule, isMain: boolean) {
|
Module._resolveFilename = function (request: string, parent: NodeModule, isMain: boolean, options?: { paths: Array<string>}) {
|
||||||
if (request === 'electron' || request.startsWith('electron/')) {
|
if (request === 'electron' || request.startsWith('electron/')) {
|
||||||
return 'electron';
|
return 'electron';
|
||||||
} else {
|
} else {
|
||||||
return originalResolveFilename(request, parent, isMain);
|
return originalResolveFilename(request, parent, isMain, options);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue