我有一个应用程序,它使用电子打包器在Mac上构建应用程序。
我的package.json:
{
"name": "desktop_v2"
"productName": "desktop v2",
"version": "1.0.0",
"license": "MIT",
"scripts": {
"build": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --dev",
"build-prod": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --prod --aot",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"package:osx": "npm run build-prod & cross-var electron-packager $npm_package_name-$npm_package_version dist --platform=darwin --arch=x64 --overwrite"
},
"build": {
"category": "your.app.category.type",
"productName": "desktop v2",
}
...
}
当我跑
时npm run package:osx
它有效,但应用程序文件名 desktop_v2-1.0.0.app 与应用程序标题相同
任务栏 desktop_v2-1.0.0 ($npm_package_name-$npm_package_version
)。我不喜欢在任务栏上看到版本。那么,我如何设置.app名称与应用程序标题名称不同?
例如:文件名:desktop_v2-1.0.0.app
应用标题:桌面版v2
答案 0 :(得分:1)
"scripts": {
"package:osx": "npm run build-prod & cross-var electron-packager Hello-World dist --platform=darwin --arch=x64 --overwrite"
},
文件名将为:Hello-World.app