Electron 客户端项目从搭建到分发的全流程(含pipeline)

最近在开发基于 WebRTC 做数据传输的文件管理工具,P-Pass File 需要对本地文件做读写操作,大量的操作干脆就直接以本地服务的方式去处理了。 之前为了快速开发客户端,使用 electron-forge vite ts 模板快速创建项目。可不曾想在主进程中使用 fork、child_process 启动 node 服务,vite 构建出来的产物会循环的启动 app,直接导致设备无法使用( issue 地址 )。找不出解决的办法,无奈只能使用老一套的方案处理了。 ...

二月 4, 2025 · 4 分钟 · 1810 字

Electron-forge + Vite + Typescript + Vue3 初始化项目

初始化 Electron Vite + TypeScript npm init electron-app@latest my-new-app -- --template=vite-typescript 安装 Vue3 npm install vue@latest 安装 Vue3 插件 npm install @vitejs/plugin-vue 修改 renderer 配置 vite.renderer.config.ts import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue'; // https://vitejs.dev/config export default defineConfig({ plugins: [vue()], }); 调整目录(按需) ├── main.ts ├── preload.ts ├── renderer │ ├── App.vue │ └── index.ts └── types 调整 index.html 入口文件 src="/src/renderer/index.ts" <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>Hello World!</title> </head> <body> <div id="app"></div> <script type="module" src="/src/renderer/index.ts"></script> </body> </html> 调整脚本入口文件 /src/renderer/index.ts ...

十一月 7, 2024 · 1 分钟 · 386 字