I'm using the boilerplate react-photonkit/epp and everything is well executed on dev when running yarn start.
But then, when I want to package my app with yarn run build-osx, the app is generated but I have an error when launching it. This error appears only when I try to import electron. If not, the app is running in production.
Uncaught ReferenceError: electron is not defined
Here is my webpack config, the only thing I have added is target:"electron". I also tried with externals: {electron: "electron"}.
I tried to import dialog from electron like this:
const {dialog} = require('electron').remote;
Or
const {dialog} = window.require('electron').remote;