32 lines
820 B
JavaScript
32 lines
820 B
JavaScript
#!/usr/bin/env node
|
|
const { execSync } = require('child_process');
|
|
const { setupCodeSigning } = require('./build-helpers');
|
|
|
|
// Set NODE_ENV
|
|
process.env.NODE_ENV = 'production';
|
|
|
|
console.log('Starting Electron build process...');
|
|
|
|
try {
|
|
// Set up code signing if needed
|
|
setupCodeSigning();
|
|
|
|
// Build Next.js app with static export
|
|
console.log('Building Next.js application...');
|
|
execSync('cross-env ELECTRON_BUILD=true next build', {
|
|
stdio: 'inherit',
|
|
env: { ...process.env }
|
|
});
|
|
|
|
// Build Electron app
|
|
console.log('Building Electron application...');
|
|
execSync('electron-builder', {
|
|
stdio: 'inherit',
|
|
env: { ...process.env }
|
|
});
|
|
|
|
console.log('Electron build completed successfully!');
|
|
} catch (error) {
|
|
console.error('Electron build failed:', error);
|
|
process.exit(1);
|
|
}
|