-
-
Notifications
You must be signed in to change notification settings - Fork 88
Expand file tree
/
Copy pathelectron-builder.config.cjs
More file actions
186 lines (167 loc) · 5.4 KB
/
electron-builder.config.cjs
File metadata and controls
186 lines (167 loc) · 5.4 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8'));
const { name, version, description, author } = packageJson;
console.log('🔧 LOADING electron-builder.config.js WITH BYTENODE HOOK...');
module.exports = {
appId: 'tv.megacubo.app',
productName: 'Megacubo',
executableName: 'Megacubo',
copyright: `Copyright © ${new Date().getFullYear()} ${author.name}`,
// Configurações gerais
directories: {
output: 'dist_optimized',
buildResources: 'build'
},
files: [
// Arquivos JavaScript compilados essenciais
'www/nodejs/dist/main.js',
'www/nodejs/dist/electron.js',
'www/nodejs/dist/preload.js',
'www/nodejs/dist/worker.js',
'www/nodejs/dist/updater-worker.js',
'www/nodejs/dist/EPGManager.js',
'www/nodejs/dist/mpegts-processor-worker.js',
'www/nodejs/dist/premium.js',
// Arquivos Svelte compilados
'www/nodejs/dist/App.js',
'www/nodejs/dist/capacitor.js',
// Dados essenciais
'www/nodejs/dist/dayjs-locale/**',
'www/nodejs/dist/defaults/**',
// Arquivos fonte e configuração
'www/nodejs/main.mjs',
'www/nodejs/package.json',
'www/nodejs/lang/**/*',
'www/nodejs/modules/**/*',
'www/nodejs/renderer/**/*',
// Exclusões críticas
'!www/nodejs/dist/electron.js.map',
'!www/nodejs/dist/main.js.map',
'!www/nodejs/dist/preload.js.map',
'!www/nodejs/dist/*.worker.js.map',
'!www/nodejs/modules/smart-recommendations/trias/**/*',
'!android/**', // Excluir diretório android completo
'!node_modules/**', // Excluir QUALQUER node_modules da raiz
'!**/android/**', // Excluir QUALQUER pasta android em qualquer lugar
'!**/*.so', // Excluir bibliotecas nativas não-Windows (.so = Linux)
'!**/*.dylib', // Excluir bibliotecas macOS (.dylib)
'!**/build/**', // Excluir pastas de build desnecessárias
'!www/nodejs/dist/node_modules/**' // Excluir TODAS as dependências node_modules
],
// Configurações específicas por plataforma
linux: {
target: [
{
target: 'AppImage',
arch: ['x64', 'arm64']
},
{
target: 'flatpak',
arch: ['x64', 'arm64']
},
{
target: 'snap',
arch: ['x64', 'arm64']
},
{
target: 'deb',
arch: ['x64', 'arm64']
},
{
target: 'rpm',
arch: ['x64', 'arm64']
}
],
category: 'Video',
icon: 'www/nodejs/default_icon.png',
synopsis: description,
description: description,
name: 'Megacubo', // Força nome maiúsculo no Linux
executableName: 'Megacubo' // Nome do executável no Linux
},
win: {
target: [
{
target: 'msi',
arch: ['x64', 'ia32']
}
],
name: 'Megacubo', // Força nome maiúsculo no Windows
executableName: 'Megacubo', // Nome do executável no Windows
publisherName: author.name,
verifyUpdateCodeSignature: false
},
msi: {
createDesktopShortcut: true,
createStartMenuShortcut: true,
runAfterFinish: true,
perMachine: false,
oneClick: false,
removeOldVersion: true,
artifactName: 'Megacubo-${version}.${ext}' // Nome do instalador MSI
},
mac: {
target: [
{
target: 'dmg',
arch: ['x64', 'arm64']
},
{
target: 'zip',
arch: ['x64', 'arm64']
}
],
icon: 'www/nodejs/default_icon.icns',
category: 'public.app-category.entertainment',
name: 'Megacubo', // Força nome maiúsculo no macOS
executableName: 'Megacubo', // Nome do executável no macOS
darkModeSupport: true,
hardenedRuntime: true,
gatekeeperAssess: false
},
// Configurações de publicação (opcional)
publish: {
provider: 'github',
owner: 'EdenwareApps',
repo: 'Megacubo',
releaseType: 'release'
},
// Configurações de build
buildVersion: version,
compression: 'maximum',
// Nota: node-gyp não é mais necessário pois o jexidb foi atualizado
// e não usa mais msgpack como dependência opcional
beforeBuild: async (context) => {
console.log('🔨 Iniciando build do Megacubo...');
console.log('📦 Plataforma:', context.platform.nodeName);
console.log('🏗️ Arquitetura:', context.arch);
console.log('🔧 CONFIG FILE LOADED: electron-builder.config.js');
},
afterPack: async (context) => {
console.log('✅ Build finished - optimized files!');
console.log('🔒 Premium bytecode compilation handled by optimized build script');
},
// Configurações de Electron
electronVersion: require('./package.json').devDependencies.electron.replace('^', ''),
asar: false, // Desabilitar ASAR para reduzir problemas de espaço
// Hooks de build
beforeBuild: async (context) => {
console.log('🔨 Iniciando build do Megacubo...');
console.log('📦 Plataforma:', context.platform?.nodeName);
console.log('🏗️ Arquitetura:', context.arch);
console.log('🔧 CONFIG FILE LOADED: electron-builder.config.cjs');
},
afterAllArtifactBuild: async (buildResult) => {
console.log('🎉 Todos os artefatos foram criados com sucesso!');
console.log('📦 Artefatos finais:');
if (Array.isArray(buildResult)) {
buildResult.forEach(artifact => {
console.log(` - ${artifact}`);
});
} else {
console.log(` - ${buildResult}`);
}
}
};