yarn create electron-app my-new-app --template=vite-typescript
yarn add --dev @electron-forge/cli
yarn electron-forge import
{
"scripts": {
"start": "electron-forge start",
"package": "electron-forge package",
"make": "electron-forge make",
"publish": "electron-forge publish"
}
//打包包配置
"config": {
"forge": {
"packagerConfig": {},
"makers": [
{
"name": "@electron-forge/maker-squirrel",
"config": {
"name": "electron_quick_start"
}
},
{
"name": "@electron-forge/maker-zip",
"platforms": [
"darwin"
]
},
{
"name": "@electron-forge/maker-deb",
"config": {}
},
{
"name": "@electron-forge/maker-rpm",
"config": {}
}
]
}
}
}
yarn add electron-squirrel-startup
-main.js 加入:
if (require('electron-squirrel-startup')) app.quit();
brew install--bark wine stable
https://www.mono-project.com/download/stable/
yarn make --platform=win32
"name": "@electron-forge/maker-dmg",
"config": {
"format": "ULFO"
}
}
yarn make --arch x64 --platform win32
asar pack ./app app.asar
yarn add --dev @electron-forge/publisher-s3
//package.json:
"publishers": [
{
"name": "@electron-forge/publisher-s3",
"platforms": ["darwin", "linux"],
"config": {
"bucket": "my-bucket",
"folder": "my/key/prefix"
}
}
]