标签:linux 桌面 javascrip col app art -- 名称 开始菜单
在使用electron-builder 打包时的一些心得希望可以帮助更多的人解决问题
一、安装 electron-builde 在此之前必须先安装yarn 当然用npm也可以只是网络不太好
yarn add electron-builder --save-dev
二、配置package.json
{ "name": "crjgui", "version": "0.0.0", "author": "samtiger <2669667558@qq.com>", "description": "An electron-vue project", "license": null, "main": "./dist/electron/main.js", "scripts": { "build": "node .electron-vue/build.js && electron-builder", "build:dir": "node .electron-vue/build.js && electron-builder --dir", "build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js", "build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js", "dev": "node .electron-vue/dev-runner.js", "e2e": "npm run pack && mocha test/e2e", "pack": "npm run pack:main && npm run pack:renderer", "pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js", "pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js", "test": "npm run unit && npm run e2e", "unit": "karma start test/unit/karma.conf.js", "postinstall": "" }, "build": { "productName": "出国(境)证件管理系统", //项目名称 "appId": "org.simulatedgreg.electron-vue", //包名 "copyright":"航星永志版权所有", //版权所有 "directories": { "output": "dist" //输出文件夹 },
"files": [ "dist/electron/**/*" ], "dmg": { "contents": [ { "x": 410, "y": 150, "type": "link", "path": "/Applications" }, { "x": 130, "y": 150, "type": "file" } ] }, "mac": { "icon": "build/icons/icon.icns" }, "win": { "icon": "build/icons/icon.ico", "target": [ { "target": "nsis", "arch": [ "ia32" ] } ] }, "linux": { "icon": "build/icons" } }, "dependencies": { ... }, "devDependencies": { ... } }
三、把installer.nsh 文件放到指定位置 也就是 在 nsis 下 include 的位置
标签:linux 桌面 javascrip col app art -- 名称 开始菜单
原文地址:https://www.cnblogs.com/chengxiang123/p/11865173.html