Request: Dev mode to also use file:// protocol
In electron-vite-react the developer mode serves index.html from a web server on localhost, but the build serves that file using the file:// protocol. Can this be changed such that development mode also uses a file?
The reason I'm requesting this is that http: and file: have a different permission structure in browsers, so things that work fine in development mode could break in production, and this is a breeding ground for bugs.
For example, cookies work on localhost but not on the file: protocol. Conversely, loading images from disk (with the file: protocol) and showing them works if you load them from a page served over the file: protocol but are prevented from being shown due to cross-origin security on localhost.
Making sure the development and production environments of your app are served over the same protocol means there is a smaller chance for bugs related to that difference.
The easiest way, you can put the built Renderer files on a remove serve. If you don't wath that, you need to start a server locally.
I want it the other way around: Both development and production using the file protocol instead of a web server. This would be a good improvement to the boilerplate.
Seems like a good idea, but would lose some great features like HRM.
You could serve the HTML as a file but HMR the JS? (Not sure if that's possible with Vite because the html is the entry-point, but it's the architecture I currently use with webpack)
To provide for the use of Electron-Renderer HTML static after buildding, will lose Vite brings many bendfits. May do more harm than good, or it's not suitable for use Vite.