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.js

67 lines
1.4 KiB
JavaScript
Raw Normal View History

2024-04-16 20:20:30 +02:00
// 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.app.id',
productName: 'Crunchyroll Downloader',
compression: 'maximum',
removePackageScripts: true,
nodeGypRebuild: true,
buildDependenciesFromSource: true,
directories: {
output: 'crunchyroll-downloader-output'
},
win: {
artifactName: 'crunchyd-Setup-${version}.${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) => {
console.log('----------------------------')
console.log('Platform:', platform)
console.log('Output:', JSON.stringify(result, null, 2))
})