Based on: https://github.com/cawa-93/vite-electron-builder The tRPC over IPC code is based on the electron-trpc package, adapted to support tRPC v10 by using tRPC source.
-
Run
npm run bootstrap
. This installs the dependencies and sets up the database. -
Run
npm run dev
This starts a development watch process usingvite
. It hot reloads on changes torenderer/
It reloads the web page on changes topreload/
It fully reloads the Electron app on changes tomain/
electron-builder
is used to compile this codebase into an executable.
- Run
npm run compile
This executes the scripts/compile.ts
file.
It uses the electron-builder
programmatic API.
If you want to compile an installable executable, change dir
to false
in the call to build()
.
The resolve.alias
stuff in vite.config.ts
files is needed because vitejs/vite#6828
By default, the Content-Security-Policy allows inline <style>
tags.
If you use a different method of applying CSS, change the relevant line in renderer/index.html
.
eg:
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self'; style-src 'self'"
/>