This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
CrunchyDL/build.ts
2024-05-01 01:45:45 +02:00

73 lines
1.7 KiB
TypeScript

// eslint-disable-next-line @typescript-eslint/no-var-requires
const builder = require('electron-builder')
const Platform = builder.Platform
/**
* @type {import('electron-builder').Configuration}
*/
const options = {
appId: 'com.stratum.crunchyrolldownloader',
productName: 'Crunchyroll Downloader',
compression: 'maximum',
removePackageScripts: true,
nodeGypRebuild: true,
buildDependenciesFromSource: true,
publish: {
provider: 'github',
releaseType: 'release'
},
directories: {
output: 'crunchyroll-downloader-output-${version}'
},
win: {
artifactName: 'crunchyroll-downloader-${version}-windows-installer.${ext}',
icon: 'public/favicon.ico',
target: [
{
target: 'nsis',
arch: ['x64', 'ia32']
}
]
},
nsis: {
deleteAppDataOnUninstall: true
},
mac: {
category: 'public.app-category.entertainment',
hardenedRuntime: false,
gatekeeperAssess: false,
target: [
{
target: 'default',
arch: ['x64', 'arm64']
}
]
},
linux: {
maintainer: 'Stratum',
desktop: {
StartupNotify: 'false',
Encoding: 'UTF-8',
MimeType: 'x-scheme-handler/deeplink'
},
target: ['AppImage', 'rpm', 'deb']
}
}
const platform = 'WINDOWS'
builder
.build({
targets: Platform[platform].createTarget(),
config: options
})
.then((result: any) => {
console.log('----------------------------')
console.log('Platform:', platform)
console.log('Output:', JSON.stringify(result, null, 2))
})