Skip to content

tsekiguchi/electron-vite-sveltekit-template

 
 

Repository files navigation

electron-vite-sveltekit-template

A minimal Electron application with TypeScript + SvelteKit + Bytenode

How it works?

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:

Recommended IDE Setup

Project Setup

Install

$ npm install # installs dependencies of `electron-vite`
$ cd src/renderer && npm install # installs dependencies of SvelteKit
$ cd ../../ # gets back to the source directory

Development

Quick start:

$ npm run dev # command starts 2 subcommands in parallel using `concurrently` npm package

If you need new dependencies for SvelteKit:

$ 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.

Build

# For windows
$ npm run build:win

# For macOS
$ npm run build:mac

# For Linux
$ npm run build:linux

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 56.2%
  • JavaScript 30.3%
  • Svelte 10.3%
  • HTML 3.2%