A Electron + Vite boilerplate of the nature of learning.
ๅญฆไน ๆง็ Electron + Vite ๆ ทๆฟๅทฅ็จ!
- ๐ฆ Out of the box
- ๐ Include only necessary dependencies
# clone the project
git clone https://github.com/electron-vite/electron-vite-boilerplate.git
# enter the project directory
cd electron-vite-boilerplate
# install dependency
npm install
# develop
npm run dev
Once dev
or build
npm-script executed will be generate named dist
folder. It has children dir of same as packages
folder, the purpose of this design can ensure the correct path calculation.
ไธๆฆ dev
ๆ build
ๅฝไปคๆง่ก่ฟๅ๏ผๅฐไผ็ๆไธ packages
็ธๅ็ปๆ dist
ๆไปถๅคน๏ผ่ฟๆ ท่ฎพ่ฎก็็ฎ็ๆฏไฟ้ๆๅปบๅ่ทฏๅพ่ฎก็ฎ็ๆญฃ็กฎๆงใ
โโโ dist After build, it's generated according to the "packages" directory
โ โโโ main/
โ โโโ preload/
โ โโโ renderer/
โ
โโโ scripts
โ โโโ build.mjs npm run build
โ โโโ watch.mjs npm run dev
โ
โโโ packages
โโโ main Main-process source code
โ โโโ vite.config.ts
โโโ preload Preload-scripts source code
โ โโโ vite.config.ts
โโโ renderer Renderer-process source code
โโโ vite.config.ts
- dependencies vs devDependencies
- Using C/C++ native addons in Electron-Renderer
- Node.js ESM packages (e.g.
execa
node-fetch
)