giftseeker
/
build.js
74 строки · 1.9 Кб
1const builder = require("electron-builder");2const Platform = builder.Platform;3
4function getCurrentPlatform() {5switch (process.platform) {6case "win32":7return Platform.WINDOWS;8case "darwin":9return Platform.MAC;10case "linux":11return Platform.LINUX;12default:13console.error("Cannot resolve current platform!");14return undefined;15}16}
17
18builder
19.build({20targets: (process.argv[2] != null && Platform[process.argv[2]] != null21? Platform[process.argv[2]]22: getCurrentPlatform()23).createTarget(),24config: {25appId: "com.giftseeker.app",26productName: "GiftSeeker",27artifactName: "giftseeker.${ext}",28copyright: "Copyright © 2016-2021 Alexander Pinashin",29files: ["src", "node_modules", "LICENSE"],30icon: "./src/resources/images/icon.ico",31win: {32target: [33{34target: "nsis-web",35arch: "x64",36},37"portable",38],39},40nsisWeb: {41artifactName: "giftseeker-setup.${ext}",42oneClick: false,43perMachine: false,44allowElevation: true,45allowToChangeInstallationDirectory: true,46},47mac: {48target: "dmg",49category: "public.app-category.games",50},51linux: {52target: ["AppImage", "deb"],53icon: "./src/resources/images/icon.256x256.png",54maintainer: "Codesprut",55vendor: "Codesprut",56synopsis: "Public giveaways helper",57description: "Automatically join giveaways",58category: "Game",59},60compression: "maximum",61extraResources: ["libraries"],62asar: true,63publish: {64provider: "generic",65url: "https://giftseeker.ru/files",66},67},68})69.then(() => {70console.log("Build complete!");71})72.catch(err => {73console.error("Error during build!", err);74});75