Adapter for building desktop apps with Svelte Kit and Electron
The sveltekit-electron-adapter is an adapter for SvelteKit apps that allows you to prerender your entire site as a collection of static files for use with Electron. With this adapter, you can create desktop apps using SvelteKit and Electron. It is a fork of the official sveltekit-static-adapter and is free and open source.
To install the sveltekit-electron-adapter, follow these steps:
npm install @ptkdev/sveltekit-electron-adapter --save-dev
svelte.config.js
file in your project and replace the default adapter with electron-adapter
.npm run build
command. Note that only pages with export const prerender = true;
are supported.src
folder of your Electron Forge project.npm run start
or generate a binary with npm run make
.There is also a boilerplate available to automate this process, which is a work in progress. You can check out the repository for more information.
The sveltekit-electron-adapter is a useful tool for integrating SvelteKit apps with Electron to create desktop applications. It allows you to prerender your site as static files and provides a straightforward setup process. With features like ease of use and an MIT License, this adapter simplifies the development of desktop apps with SvelteKit and Electron.