- 使用Nodejs编写跨平台桌面应用程序
- Electron Fiddle是官方的沙盒程序
安装配置
可以使用React脚手架来初始化electron-react-boilerplate
- 虽然它推荐的是Electron Store来存储状态,但是依然可以用redux或者mobx,并且持久化也可以直接用localStorage,mobx的话就是
mobx-persist-store
- 虽然它推荐的是Electron Store来存储状态,但是依然可以用redux或者mobx,并且持久化也可以直接用localStorage,mobx的话就是
1 | npm run start # 运行APP |
添加依赖
1
2./package.json # 非native的module,或者类型依赖@types/*
./release/app/package.json # native modules需要安装在这里,不需要编译package.json配置
1
2
3
4
5
6
7{
"build": {
"mac": {
"identity": "Apple Development: xxxx (xxx)" // 指定签名的identity,否则可能会自动选择到一个无效的identity导致应用打不开,可以用security find-identity -v查看当前所有的identity
}
}
}