Drop webpack and enjoy vite! 中文文档
- Vite 2.6.7
- ESBuild 0.13.6
- Electron 15.1.2
- React 17.0.2
- Typescript 4.4.4
// from my private source
$ git clone https://git.acgme.cn/saya/vite-electron-app.git --depth=1
// from github source
$ git clone https://github.com/AlishaHawkward/vite-electron-app.git --depth=1
Electron service entry: ./src/background.ts
React entry: ./src/main.tsx
$ npm run dev
$ npm run build
$ npm run lint
$ npm run lint:fix
Clean dist dir: npm run clean
-
Use
window.ipcRenderer.send()
from renderer process to main process. -
Use
window.ipcRenderer.on()
from main process to renderer process.
-
Main process & Render process use ipcRenderer to communicate.
-
You can use and distribute this project anywhere, but I hope you could keep the original README.MD.
-
Enjoy it!