This is a template project for building desktop applications using Electron and SvelteKit 5. It includes a modern development setup with live-reload, static builds, and cross-platform packaging using electron-builder
. Powered by Bun for superior performance.
Ensure you have the following installed on your system:
Clone this repository:
git clone https://github.com/your-username/electron-sveltekit-template.git
cd electron-sveltekit-template
Install dependencies using Bun:
bun install
Start the development environment with live-reloading:
bun run dev
This will concurrently:
To build the SvelteKit app:
bun run build:svelte
This creates the static frontend files in the dist
folder.
To package the application for your platform:
Windows:
bun run build:electron:win
Mac:
bun run build:electron:mac
Linux:
bun run build:electron:linux
The output package can be found in the dist
folder.
Command | Description |
---|---|
bun run dev |
Start the development environment with live-reloading. |
bun run build:svelte |
Build the SvelteKit frontend for production. |
bun run build:electron:win |
Package the app for Windows. |
bun run build:electron:mac |
Package the app for Mac. |
bun run build:electron:linux |
Package the app for Linux. |
electron-sveltekit-template/
├── src/
│ ├── backend/ # Electron main process
│ │ └── main.js
│ │ └── preload.js
│ ├── routes/ # SvelteKit routes
│ └── app.html # HTML entry point
├── dist/ # Build output
├── package.json # Project dependencies and scripts
└── vite.config.js # Vite configuration
Feel free to fork this repository and make your own changes. Contributions are welcome!