diff --git a/lib/common/reset-search-paths.js b/lib/common/reset-search-paths.js index 72449559b224..4d09f6c89ca6 100644 --- a/lib/common/reset-search-paths.js +++ b/lib/common/reset-search-paths.js @@ -36,6 +36,8 @@ Module._nodeModulePaths = function (from) { return paths } +// Patch Module._resolveFilename to always require the Electron API when +// require('electron') is done. const electronPath = path.join(__dirname, '..', process.type, 'api', 'exports', 'electron.js') const originalResolveFilename = Module._resolveFilename Module._resolveFilename = function (request, parent, isMain) {