-
Notifications
You must be signed in to change notification settings - Fork 57
Webpack support - don't use require.resolve(), allow user to use it if necessary #42
base: master
Are you sure you want to change the base?
Webpack support - don't use require.resolve(), allow user to use it if necessary #42
Conversation
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.
The core of the issue here (from what I can tell) is that
I think this means any Node.js/Electron library that uses |
Development note: when npm/yarn linking, be sure to ./build.sh the code after making changes. And with the electron-react-boilerplate project, electron-remote should be added to app/package.json, not package.json, and you should |
Hi, i'm using web pack and i doesn't can use electron-remote. in which version is this feather? How i can use it in beta? |
i am also getting this issue. |
please, accept |
Might this workaround the issue within the lib? Comment |
Please accept this PR |
What's left to accept this? |
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.
Here is an example that integrates electron-remote with electron-react-boilerplate project, which uses Webpack to produce the main process and renderer code: aguynamedben/electron-react-boilerplate#1
Before making this change, I would run into the problem documented here: electron-react-boilerplate/electron-react-boilerplate#1587
Please let me know if there is a better way to fix this. From what I can tell,
require.resolve()
(from Node) is overwritten by Webpack.