Obfuscating the code stay a good option, you can take a look at : https://github.com/javascript-obfuscator/javascript-obfuscator
In the Electron world, it is possible to add a step during build that consist in doing obfuscation. Note that, it may increase the size of the final installer/executable.