大家好,欢迎来到IT知识分享网。
《开源精选》是我们分享Github、Gitee等开源社区中优质项目的栏目,包括技术、学习、实用与各种有趣的内容。本期推荐的是一个入门简单、跨平台、企业级桌面软件开发框架。
特性
- 跨平台:一套代码,可以打包成windows版、Mac版、Linux版、国产UOS、Deepin、麒麟等
- 简单高效:只需学习 js 语言
- 前端独立:理论上支持任何前端技术,如:vue、react、html等等
- 工程化:可以用前端、服务端的开发思维,来编写桌面软件
- 高性能:事件驱动、非阻塞式IO
- 功能丰富:配置、通信、插件、数据库、升级、打包、工具… 应有尽有
- 安全:支持字节码加密、压缩混淆加密
- 功能demo:桌面软件常见功能,框架集成或提供demo
使用场景
常规桌面软件
- windows平台
- macOS平台
- linux平台 – 国产UOS、Deepin
- linux平台 – ubuntu
vue、react、angular、web 转换成桌面软件
- vue-ant-design(本地)
- 禅道项目管理(web项目地址)
游戏(h5相关技术开发)
- 忍者100层
开始使用
准备
- 推荐 node.js >= 14.21.1
下载
# gitee git clone https://gitee.com/dromara/electron-egg.git # github git clone https://github.com/dromara/electron-egg.git
安装
# 设置国内镜像源(加速) npm config set registry=https://registry.npmmirror.com npm config set disturl=https://registry.npmmirror.com/-/binary/node #如果下载electron慢,配置如下(或者挂个VPN) npm config set electron_mirror=https://registry.npmmirror.com/-/binary/electron/ # 进入目录 ./electron-egg/ npm install # 如果还是提示 electron 没安装,进入 node_modules/electron 目录下,再npm install # 构建sqlite # - 需要 python3 环境 (操作系统自带) # - 需要 node-gyp npm i node-gyp -g npm run re-sqlite # 如果sqlite报错 ...tools之类的 npm --vs2015 i -g --production windows-build-tools 或者 npm i -g --production windows-build-tools
常用命令
# 开发者模式 # 1:【进入前端目录】,启动前端服务 cd electron-egg/frontend && npm install && npm run serve # 2:【根目录】,启动后端服务 npm run dev # 开发模式(主进程) npm run dev # 开发模式-热加载(主进程) npm run reload # 预发布模式(环境变量为:prod) npm run start # 打包 (windows版) npm run build-w (32位) npm run build-w-64 (64位) npm run build-w-arm64 (arm64) # 打包 (windows 免安装版) # ee > v2.2.1 npm run build-wz (32位) npm run build-wz-64 (64位) npm run build-wz-arm64 (arm64) # 打包 (mac版) npm run build-m npm run build-m-arm64 (m1芯片架构) # 打包 (linux版) # ee > v2.2.1 npm run build-l (32位 deb包) npm run build-l-64 (64位 deb包) npm run build-l-arm64 (64位 deb包 arm64) npm run build-l-armv7l (64位 deb包 armv7l) npm run build-lr-64 (64位 rpm包) npm run build-lp-64 (64位 pacman包) # 移动前端静态资源 npm run rd # 代码加密 npm run encrypt
项目案例
英雄联盟助手
-END-
开源协议:Apache-2.0
开源地址:https://gitee.com/dromara/electron-egg
免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://haidsoft.com/159554.html