config.js
1 /* eslint-disable no-template-curly-in-string */ 2 const dotenv = require('dotenv') 3 const packageJson = require('../../package.json') 4 5 const baseConfig = { 6 productName: packageJson.name, 7 appId: packageJson.appId, 8 asar: true, 9 extends: null, 10 compression: 'maximum', 11 artifactName: '${productName}__${version}_${os}_${arch}.${ext}', 12 directories: { 13 output: './release/${version}' 14 }, 15 mac: { 16 hardenedRuntime: true, 17 gatekeeperAssess: false, 18 notarize: false, 19 icon: 'buildAssets/icons/icon.icns', 20 type: 'distribution', 21 target: [ 22 { 23 target: 'dmg', 24 arch: ['x64', 'arm64', 'universal'] 25 } 26 ] 27 }, 28 dmg: { 29 contents: [ 30 { 31 x: 410, 32 y: 150, 33 type: 'link', 34 path: '/Applications' 35 }, 36 { 37 x: 130, 38 y: 150, 39 type: 'file' 40 } 41 ], 42 sign: false 43 }, 44 win: { 45 icon: 'buildAssets/icons/icon.ico', 46 target: [ 47 { 48 target: 'appx', 49 arch: 'x64' 50 }, 51 { 52 target: 'zip', 53 arch: 'x64' 54 }, 55 { 56 target: 'portable', 57 arch: 'x64' 58 }, 59 { 60 target: 'nsis', 61 arch: 'x64' 62 } 63 ] 64 }, 65 portable: { 66 artifactName: '${productName}__${version}_${os}_${arch}_Portable.${ext}' 67 }, 68 nsis: { 69 oneClick: true 70 }, 71 linux: { 72 executableName: packageJson.name.toLowerCase(), 73 icon: 'buildAssets/icons', 74 category: 'Utility', 75 target: [ 76 { 77 target: 'snap', 78 arch: 'x64' 79 }, 80 { 81 target: 'deb', 82 arch: 'x64' 83 }, 84 { 85 target: 'rpm', 86 arch: 'x64' 87 }, 88 { 89 target: 'tar.gz', 90 arch: 'x64' 91 } 92 ] 93 } 94 } 95 96 dotenv.config() 97 98 baseConfig.copyright = `ⓒ ${new Date().getFullYear()} $\{author}` 99 baseConfig.files = [ 100 /* A list of files not to be included in the build. */ 101 /* 102 (Required) The files and folders listed below should not be included in the build. 103 */ 104 'dist/**/*', 105 '!dist/main/index.dev.js', 106 '!docs/**/*', 107 '!tests/**/*', 108 '!release/**/*' 109 ] 110 111 baseConfig.extraResources = [ 112 { 113 from: 'src/main/assets', 114 to: 'assets' 115 } 116 ] 117 118 // TODO: Notarize for macOS 119 baseConfig.mac.identity = null 120 /* if (process.env.MAC_NOTARIZE === 'true') { 121 baseConfig.afterSign = './buildAssets/builder/notarize.ts' 122 } else { 123 baseConfig.mac.identity = null 124 } */ 125 126 module.exports = { 127 ...baseConfig 128 }