git clone <this-project>
# 安装依赖
yarn
# 开始开发服务器, 将使用webpack编译程序, 并运行electron
yarn start
# 构建生产环境代码
yarn build
# 打包electron程序
yarn package
- Typescript 支持类型检查的Javascript超集
- Electron
- React 前端视图框架
- Yarn Node包管理工具
dist/ # 编译输出目录
src/ # 源代码
main/ # 主进程
index.ts
index.tsx # index页面入口
login.tsx # login页面入口
page.json # 页面配置
renderer页面在src/page.json
中定义, 例如:
{
"index": {
"width": 360,
"minWidth": 360,
"height": 780,
"minHeight": 500,
"frame": false,
"minimizable": false,
"maximizable": false,
"alwaysOnTop": true,
"skipTaskbar": true
},
"login": {},
"webview": {}
}
根字段名表示页面名称, 属性值是窗口(BrowserWindow
)的配置参数.
每一个页面必须在src
目录下有一个对应的Javascript入口文件.
本项目使用jm-cli
进行代码构建. jm-cli
是mygzb前端
项目的构建工具.