electron-userland / electron-remote

DEPRECATED: Execute JavaScript in remote Electron processes, but more betterer
MIT License
429 stars 57 forks source link

Webpack compatibility #34

Open bthallion opened 6 years ago

bthallion commented 6 years ago

Does this module support using webpack with electron?

aguynamedben commented 6 years ago

FWIW I'm trying to get this working with electron-react-boilerplate, and the usage of require.resolve() at https://github.com/electron-userland/electron-remote/blob/master/src/renderer-require.js#L44 seems to conflict with that project's usage of Webpack.

See this for the details of getting electron-remote working with Webpack: https://github.com/chentsulin/electron-react-boilerplate/issues/1587

Apparently require.resolve() and Webpack don't play nicely with each other. I'm not well-versed on the history of require(), require.resolve(), dynamic import(), and how they all work between the Node.js, Webpack, Babel, and Electron ecosystems, but I'm trying to figure it out if anybody has any quick pointers.

aguynamedben commented 6 years ago

I had to make a small change to get Webpack working: https://github.com/electron-userland/electron-remote/pull/42