Skip to main content
  1. Posts/

Electron Stu

·160 words·1 min· loading · loading · ·
Author
Zhenda
A personal website
web - This article is part of a series.
Part : This Article

quickstart
#

npm init -y
npm install electron --save-dev
// package.json
"main": "main.js",
  "scripts": {
    "start": "electron .",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
npm run start
// 加载页面
.loadFile()

为了将 Electron 的不同类型的进程桥接在一起,我们需要使用被称为 预加载 的特殊脚本。

package
#

最简单的软件要300M

前置
#

环境
#

npm install --save-dev @electron-forge/cli
npx electron-forge import

如果发布rpm包, 需要安装环境

sudo apt install rpm

添加 元数据
#

// package.json
"description": "a demo for stu electron",
"author": "zhangzhenda <zhangsan@example.com>",

本地打包
#

npm run make

github的cicd打包
#

link#

https://www.electronjs.org/zh/docs/latest/

web - This article is part of a series.
Part : This Article