当前位置: 首页 > news >正文

如何使用electron-forge开发上位机ui

Electron Forge是一个用于快速构建、打包和发布Electron应用程序的工具。它提供了一种简单的方式来设置Electron项目,并使用现代工具和最佳实践来管理应用程序的开发和部署过程。使用Electron Forge,开发人员可以轻松地创建跨平台的桌面应用程序,无需深入了解Electron的底层技术细节。Electron Forge提供了一系列的命令行工具和配置选项,使得构建和发布Electron应用变得更加简单和高效。
要下载和安装ElectroForge,您可以按照以下步骤操作:
官网
1、首先你得安装npm,自行搜索

npm install -g electron-forge

在这里插入图片描述
等待安装完成
2、创建你的第一个代码程序

npx create-electron-app@latest my-app

Using templates
Forge’s initialization scripts can add additional template code with the --template=[template-name] flag.

npx create-electron-app@latest my-app --template=webpack

There are currently four first-party templates:

webpack

webpack-typescript

vite

vite-typescript

All of these templates are built around plugins that bundle your JavaScript code for production and includes a dev server to provide a better developer experience.

3、启动代码

cd my-app
npm start

在这里插入图片描述

4、编译代码

npm run make

在这里插入图片描述
生成可执行 程序,交货,下班。

5、Publishing your app
Now you have distributables that you can share with your users. If you run the publish script, Electron Forge will then publish the platform-specific distributables for you, using the publishing method of your choice. For example, if you want to publish your assets to GitHub, you can install the GitHub publisher dependency using:

npm install --save-dev @electron-forge/publisher-github

Once you have configured the publisher according to the documentation, run the following command to upload your distributables:

npm run publish

For more information on what publishers we currently support, check out the Publishers documentation.

6、下一步开始添加自己的功能吧。

相关文章:

  • 2024ICPC成都题解
  • word2Vec与GloVe的区别
  • MySQL数据库(14)—— 使用C操作MySQL
  • 【学习笔记】机器学习(Machine Learning) | 第四章(3)| 多变量线性回归
  • 算法训练营第五天 | 哈希表理论基础、 242.有效的字母异位词、349. 两个数组的交集、 202. 快乐数、1. 两数之和
  • 最新Spring Security实战教程(十三)会话管理机制 - 并发控制与会话固定攻击防护
  • qnn-2-27 sdk 环境配置示例
  • 逆向设计——CWDM_splitter
  • 8.2 段落格式
  • 一文了解 模型上下文协议(MCP)
  • 数据库Mysql学习——day7(多表查询(JOIN)进阶)
  • 检测图片指定多个位子像素坐标与目标比较。外部图像识别。如红色,黄色,绿色。。。
  • HTML 从标签到动态效果的基础
  • [计算机科学#4]:二进制如何塑造数字世界(0和1的力量)
  • JAVA:线程池
  • H3C华三:单臂路由配置
  • 用Postman验证IAM Token的实际操作
  • 2025年五一数学建模竞赛AI辅助全网专业性第一
  • 网络安全入门综述
  • 乐理学习笔记(一)---节拍与音符
  • 深圳专业网站建设制作价格/免费推广引流平台推荐
  • 郓城菏泽网站建设/合肥百度关键词优化
  • 网站开发与部署/近期国内外重大新闻10条
  • 缅甸做网站/线下推广渠道有哪些方式
  • 邯郸做网站推广/运营培训班有用吗
  • 武汉机械加工网/培训优化