步骤
下载官方的Demo
代码语言:javascript复制git clone https://github.com/electron/electron-quick-start
cd electron-quick-start
npm install // 或者 yarn install
npm start
electron-packager打包
安装依赖
代码语言:javascript复制npm install electron-packager --save-dev
win
代码语言:javascript复制"scripts": {
"electron_build": "electron-packager ./ --platform=win32 --arch=x64 --overwrite"
}
electron-builder打包
代码语言:javascript复制npm install electron-builder --save-dev
在package.json
中做如下配置
"build": {
"appId": "com.xxx.app",
"mac": {
"target": ["dmg","zip"]
},
"win": {
"target": ["nsis","zip"]
}
},
"scripts": {
"dist": "electron-builder --win --x64"
},