Can the same index.html file be used by both an Electron process and a browser like Chrome?
I have created an app that has its own Hapi server to handle HTTP requests to a database, which is working fine. However, when I try to serve the index.html
file from inside Electron's asar, I receive an error stating "module is not defined" when trying to open Hapi's route in Chrome.
It seems that renderer.js
is compiled using es2016 instead of es2015. I have attempted to use webpack plugins, but they are causing various errors rather than allowing me to recompile the app successfully.
I used this template for reference.
Is there a reliable method to achieve a consistent UI for both Electron users and browser users?
EDIT: A similar issue was found at https://github.com/SimulatedGREG/electron-vue/issues/195