A minimal Electron application with TypeScript + SvelteKit + Bytenode
Template utilizes electron-vite for its ability to bundle & compile node.js (main & renderer files) to V8 Bytecode.
Template doesn't use renderer
part of electron-vite, but rather embeds SvelteKit into the project as sub-project in src/renderer
directory with it's own dependencies. SvelteKit is configured with adapter-static to build SPA (Single Page Application) with static HTML/CSS/JS.
Esentially it gives the best of both worlds:
- Electron (backend) from electron-vite
- Anything you can think of with SvelteKit (within the limits of adapter-static)
$ npm install # installs dependencies of `electron-vite`
$ cd src/renderer && npm install # installs dependencies of SvelteKit
$ cd ../../ # gets back to the source directory
$ npm run dev # command starts 2 subcommands in parallel using `concurrently` npm package
$ cd src/renderer # navigate to SvelteKit directory & do things from there
(!!!) Don't forget to go back to source directory with cd ../../
after you installed necessary dependencies.
# For windows
$ npm run build:win
# For macOS
$ npm run build:mac
# For Linux
$ npm run build:linux