1

I'm trying to do pretty much the same thing as this post: Using node require with Electron and Webpack

Basically, I need Electron to read other js files that weren't together in the build. But when using global.require, I'm getting the following error:

webpack_require.g.require is not a function

I can use require(module) normally, but not global.require(module)

My code in App.js:

var comp = (global.require('../../plugins/' + plugin).default);
alert(Object.keys(comp));

Any idea?

0 Answers0