I'm experiencing an issue when using electron in combination with create-react-app-typescript. For security reasons it's advised to set nodeIntegration: false when creating a new electron browserWindow(to avoid XSS). You should then expose the node API's you need via the preload script by attaching those to global or window. I did this with the electron package but doesn't get attached to the window and I'm getting an error; ReferenceError: require is not defined on module.exports = require("electron"); in the bundle.
Anyone has an idea what I'm overlooking? I'm using the default webpack of the create-react-app-typescript library (I ejected the app). Also, the app should work on both electron and in the browser. I'd love some help or anyone that could point me in the right direction.