Prerequisites
Before building the desktop app, ensure you have:- Bun runtime installed
- Repository cloned with submodules (see local development)
- Dependencies installed (
bun install)
Build Configuration
The desktop build is configured inpackage.json using electron-builder:
Building for All Platforms
Windows
Build an NSIS installer for Windows:Run the Windows build script
- Compiles TypeScript (
tsc) - Builds the app with Vite in desktop mode (
IS_DESKTOP=true vite build) - Generates the format cache (
bun run cache:build) - Packages with electron-builder for Windows
On non-Windows systems, you may need Wine installed to build Windows targets.
macOS
Build a DMG installer for macOS:Linux
Build an AppImage for Linux:Development Workflow
For testing the desktop app during development:Available Scripts
Here are all desktop-related scripts frompackage.json:
| Script | Command | Description |
|---|---|---|
| desktop:build | bun run desktop:build | Build app with TypeScript, Vite, and cache generation |
| desktop:preview | bun run desktop:preview | Launch built app in Electron |
| desktop:start | bun run desktop:start | Build and preview in one command |
| desktop:dist:win | bun run desktop:dist:win | Package Windows installer (NSIS) |
| desktop:dist:mac | bun run desktop:dist:mac | Package macOS installer (DMG) |
| desktop:dist:linux | bun run desktop:dist:linux | Package Linux installer (AppImage) |
Environment Variables
The desktop build uses a special environment variable:IS_DESKTOP=true- Tells Vite to build in desktop mode
Output Directory Structure
After building, your project will have:Distribution
Code Signing
For production releases, you should sign your applications: Windows:- Use a code signing certificate
- Configure in
package.jsonunderwin.certificateFile
- Requires Apple Developer account
- Configure signing identity in
package.jsonundermac.identity - Notarization recommended for macOS 10.15+
- AppImages don’t require signing but can be verified
Auto-Updates
To enable auto-updates, configure electron-builder’s publish options:--publish flag:
The default scripts use
--publish never to prevent accidental releases.Troubleshooting
Build fails on TypeScript compilation
Make sure all dependencies are installed:Cache generation fails
Ensure Chromium dependencies are available (needed for Puppeteer inbuildCache.js):
AppImage won’t run on Linux
Make the AppImage executable:Large bundle size
The desktop app includes all conversion tools and their dependencies (FFmpeg, ImageMagick WASM, etc.), resulting in a large bundle. This is expected and necessary for offline functionality.Next Steps
- Set up local development environment
- Deploy using Docker
- Learn about adding file format handlers