Desktop and Web

The same React codebase powers both the browser SPA and the Electron desktop app. Two Vite configs handle the difference.

Vite configs

ConfigPurpose
vite.web.config.mtsBrowser build. Outputs a static SPA.
vite.renderer.config.mtsElectron renderer. Same source, different output target.
vite.main.config.mtsElectron main process (window management, IPC, menus).
vite.preload.config.mtsElectron preload script (IPC bridge).

Running each target

# Browser dev server (port 4200)
pnpm --filter @hype-stack/frontend dev

# Electron app with hot reload
pnpm --filter @hype-stack/frontend start:app

What's different in Electron

Sharing code between targets

Both targets import from the same src/ directory. Platform-specific code is handled through:

Building for production

# Web production build
pnpm --filter @hype-stack/frontend build

# Electron production package
pnpm --filter @hype-stack/frontend package