const { execSync } = require('child_process'); const fs = require('fs'); const path = require('path'); console.log('Compiling TypeScript...'); execSync('npx tsc', { stdio: 'inherit' }); const sourcePath = path.join(__dirname, 'ca.pem'); const destPath = path.join(__dirname, 'dist', 'ca.pem'); if (fs.existsSync(sourcePath)) { fs.copyFileSync(sourcePath, destPath); console.log('ca.pem copied to dist folder successfully.'); } else { console.error('ca.pem not found in project root. Please ensure it exists.'); process.exit(1); } console.log('Build completed successfully.');