-
Notifications
You must be signed in to change notification settings - Fork 1
/
electron-builder.config.js
64 lines (59 loc) · 1.47 KB
/
electron-builder.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const fsp = require('fs/promises');
const path = require('path');
const buildFilesPath = path.join(__dirname, 'build');
const publishPath = path.join(__dirname, 'publish');
/**
* @type {import('electron-builder').Configuration}
* @see https://www.electron.build/configuration/configuration
*/
const config = {
afterAllArtifactBuild: async () => {
const outDir = path.join(__dirname, 'bin');
const winUnpacked = path.join(outDir, 'win-unpacked');
const binary = path.join(path.join(__dirname, 'bin'), 'tmcp.exe');
await fsp.rm(publishPath, { recursive: true, force: true });
await fsp.mkdir(publishPath, { recursive: true });
await fsp.cp(buildFilesPath, winUnpacked, { recursive: true });
await fsp.cp(buildFilesPath, publishPath, { recursive: true });
await fsp.copyFile(binary, path.join(`${publishPath}`, 'tmcp.exe'));
},
asar: true,
appId: 'topheranselmo.tmcp',
productName: `Topher's Modular Command Palette`,
icon: 'media/tmcp.ico',
directories: {
output: 'bin'
},
files: [
'package.json',
{
from: 'dist',
to: './'
},
{
from: 'dist_electron',
to: 'dist_electron'
}
],
win: {
artifactName: 'tmcp.${ext}',
target: [
{
target: 'dir',
arch: ['x64']
},
{
target: 'portable',
arch: ['x64']
}
],
executableName: 'tmcp'
},
extraFiles: [
{
from: 'media',
to: 'media'
}
]
};
module.exports = config;