This is a minimalistic demo about the way mixing Electron, Parcel and Typescript. And also React!
- Automated building
- Whether it's the main or render process, the code is transpiled using Parcel, so it should be very fast.
- Fully typed, even with a hack that types the contextBridge.
During development, when running yarn start
,
- Launch Parcel development server, loading
public/template.html
, which further loadssrc/renderer/index.tsx
. - Transpile
src/main/index.ts
andsrc/preload/index.ts
, using the automation script inconfig
, also with Parcel. - Launch electron on
dist/main/index.js
.
when building (yarn build
),
- Call
npm run clean
, which removes thedist/public
directory to avoid redundant files. - Build
public/template.html
using Parcel. - Transpile
src/main/index.ts
andsrc/preload/index.ts
, using the automation script inconfig
, also with Parcel. - Build the
dist
directory into the package, with nothing else.