41 lines
1.0 KiB
JavaScript
41 lines
1.0 KiB
JavaScript
const esbuild = require('esbuild');
|
|
const path = require('path');
|
|
|
|
async function build() {
|
|
try {
|
|
console.log('Building main process with esbuild...');
|
|
|
|
// Build main process
|
|
await esbuild.build({
|
|
entryPoints: ['src/apps/companion/main/index.ts'],
|
|
bundle: true,
|
|
platform: 'node',
|
|
target: 'node20',
|
|
format: 'cjs',
|
|
outfile: 'dist/main/apps/companion/main/index.js',
|
|
external: ['electron'],
|
|
sourcemap: true,
|
|
logLevel: 'info',
|
|
});
|
|
|
|
// Build preload script
|
|
await esbuild.build({
|
|
entryPoints: ['src/apps/companion/main/preload.ts'],
|
|
bundle: true,
|
|
platform: 'node',
|
|
target: 'node20',
|
|
format: 'cjs',
|
|
outfile: 'dist/main/apps/companion/main/preload.js',
|
|
external: ['electron'],
|
|
sourcemap: true,
|
|
logLevel: 'info',
|
|
});
|
|
|
|
console.log('✓ Main process and preload script built successfully');
|
|
} catch (error) {
|
|
console.error('✗ Build failed:', error);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
build(); |