mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 08:13:37 +00:00
feat: enhance Electron app packaging and server preparation
- Added afterPack script in package.json to rebuild native modules for the server bundle. - Improved icon handling in main.js to support cross-platform formats and verify icon existence. - Updated startStaticServer function to return a promise for better error handling. - Introduced a new script, rebuild-server-natives.js, to rebuild native modules based on the target architecture. - Enhanced prepare-server.js to include native module rebuilding step for improved terminal functionality.
This commit is contained in:
@@ -64,4 +64,18 @@ execSync('npm install --omit=dev', {
|
||||
}
|
||||
});
|
||||
|
||||
// Step 6: Rebuild native modules for current architecture
|
||||
// This is critical for modules like node-pty that have native bindings
|
||||
console.log('🔨 Rebuilding native modules for current architecture...');
|
||||
try {
|
||||
execSync('npm rebuild', {
|
||||
cwd: BUNDLE_DIR,
|
||||
stdio: 'inherit'
|
||||
});
|
||||
console.log('✅ Native modules rebuilt successfully');
|
||||
} catch (error) {
|
||||
console.warn('⚠️ Warning: Failed to rebuild native modules. Terminal functionality may not work.');
|
||||
console.warn(' Error:', error.message);
|
||||
}
|
||||
|
||||
console.log('\n✅ Server prepared for bundling at:', BUNDLE_DIR);
|
||||
|
||||
Reference in New Issue
Block a user