一個公司做兩個網(wǎng)站的好處seo上海培訓
沒有配置files選項
files的作用是配置打包到應用程序的構建資源 就是說如果你想使用項目那個目錄下的文件 就得通過files配置一下不然就會報錯
json文件或者yml文件會報的錯
格式是這樣的
"files": ["dist-electron", "dist"],
electron打包配置的幾種方式
- 直接在package.json中配置
- 在項目根目錄下創(chuàng)建electron-builder.yml文件配置
- 根目錄下創(chuàng)建
.json
、json5
、toml
文件配置 - 配置文檔 http://electron.org.cn/builder//configuration/configuration.html
electron打包要注意的事項
- 文件路徑不要包含中文
- electron-builder配置也不要包含中文
用過的項目配置
{"productName": "項目名稱","appId": "appId","directories": {"output": "release/v${version}" // 項目輸出目錄},"files": ["dist-electron", "dist"], // 要用到的構建資源"asar": true,"nsis": {"oneClick": false, // 是否創(chuàng)建一鍵式安裝程序或輔助。"perMachine": true, // 是否顯示輔助安裝程序的安裝模式安裝程序頁面(選擇每臺機器或每個用戶)。或者安裝是否總是針對所有用戶(每臺機器)。"shortcutName": "${productName}", // 將用于所有快捷鍵的名稱。默認為應用程序名稱"uninstallDisplayName": "${productName}", // 卸載程序在控制面板上的顯示名稱。"runAfterFinish": true, // 完成后是否運行安裝的應用程序。對于輔助安裝程序,相應的復選框將被刪除。"deleteAppDataOnUninstall": true, // 只有一鍵式安裝程序。卸載時是否刪除應用數(shù)據(jù)。"allowToChangeInstallationDirectory": true, // 僅輔助安裝。是否允許用戶更改安裝目錄"removeDefaultUninstallWelcomePage": true, // 僅輔助安裝。是否刪除默認的卸載歡迎頁面},"win": {"icon": "dist/favicon.ico","artifactName": "${productName} v${version}.${ext}","requestedExecutionLevel": "requireAdministrator"},"dmg": {"sign": false},"mac": {"target": "dmg","icon": "dist/osicon.png","hardenedRuntime": true,"gatekeeperAssess": false},"linux": {"target": ["AppImage","deb"],"icon": "dist/winicon.png","artifactName": "${productName} v${version}.${ext}","desktop": {"Icon": "/opt/v3-electron-vite/resources/app/dist/winicon.png"}}
}