From cff0c0d90e23d87aaab55a41c76adf5319fbc260 Mon Sep 17 00:00:00 2001 From: Ben Standefer Date: Thu, 14 Jun 2018 17:44:24 -0700 Subject: [PATCH] Webpack support - don't use require.resolve(), allow user to use it The README and in-code comment instructs users they may need to use require.resolve() to provide the correct path to requireTaskPool. This is a problem for Webpack users because Webpack rewrites require.resolve(). Removing require.resolve() enables Webpack users to use electron-remote. I'm not sure, but I think for some users who implicitly depend on the current behavior of electron-remote require.resolve()-ing for them, this may be a breaking change. --- src/renderer-require.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer-require.js b/src/renderer-require.js index e7f8722..94bdec3 100644 --- a/src/renderer-require.js +++ b/src/renderer-require.js @@ -41,7 +41,7 @@ const BrowserWindow = process.type === 'renderer' ? */ export async function rendererRequireDirect(modulePath, timeout=240*1000) { let bw = new BrowserWindow({width: 500, height: 500, show: false}); - let fullPath = require.resolve(modulePath); + let fullPath = modulePath; let ready = Observable.merge( fromRemoteWindow(bw, 'did-finish-load', true),