Electron application Packaging
Electron Application Package Installation Electron-packager Modify Packagejson file Package
After the previous blog installation Electron-packager
$ sudo cnpm install--save-dev Electron-packager
modifying Package.json files
{
"name": "MyApp", "
Version": "0.1.0",
"main": "Main.js",
"scripts": {
"start": "Electron Main.js ","
Packager ":" Electron-packager. --platform=linux--electron-version=1.6.6 --overwrite "
},
" Devdependencies ": {
" Electron-packager ":" ^8.7.0 "
}
}
Note: Only the Linux platform is specified here, and you can modify packages that are packaged all over the platform. Packaged
$ ELECTRON_MIRROR=HTTP://NPM.TAOBAO.ORG/MIRRORS/ELECTRON/NPM Run-script Packager
here to explain, the above command set the Electron_mirror use Taobao image, if not using Taobao mirror, download the package will be wrong.
After packing, you can see that a myapp-linux-x64 directory is generated under MyApp, and running Myapp-linux-x64/myapp can start the application.