Open rafaellehmkuhl opened 1 month ago
My hacky workaround here for now:
On package.json
:
"dev:electron": "ELECTRON=true vite --host"
On vite.config.ts
:
// Check if we're running in Electron mode
const isElectron = process.env.ELECTRON === 'true'
export default defineConfig({
plugins: [
isElectron &&
electron(...),
...
].filter(Boolean),
...
The project I work on supports usage as both an electron app as well as a web page, and most of the time, for practical purposes, we develop by previewing only the application as a web page, not dealing with the electron window.
We have a script command called
dev
which callsvite --host
. We were previously using version0.9.3
of this plugin, in which the electron window was not being opened by default, but since we updated to the latest version (0.28.8
), the electron window is being opened by default with this same command.Is there a way to disable it, so I can have a dedicated command (e.g.:
dev:electron
) that explicitly calls for the electron window to be opened (e.g.:vite --host && electron .
)?