feat(tsbundle): add configurable maxLineLength for base64ts output and improve build/error handling in child builds

This commit is contained in:
2026-01-12 01:41:08 +00:00
parent 54f84ba114
commit 8b6ae043a2
7 changed files with 108 additions and 53 deletions

View File

@@ -61,15 +61,21 @@ export class CustomBundleHandler {
// Build the bundle to temp location
const tsbundle = new TsBundle();
await tsbundle.build(
this.cwd,
bundleConfig.from,
tempBundlePath,
{
bundler,
production: bundleConfig.production || false,
}
);
try {
await tsbundle.build(
this.cwd,
bundleConfig.from,
tempBundlePath,
{
bundler,
production: bundleConfig.production || false,
}
);
} catch (error: any) {
console.error(`\n\x1b[31m❌ Bundle failed: ${bundleConfig.from} -> ${bundleConfig.to}\x1b[0m`);
// Don't re-print error details - they were already shown by the child process
return; // Skip output handling since build failed
}
if (outputMode === 'base64ts') {
await this.handleBase64TsOutput(bundleConfig, tempBundlePath);
@@ -105,7 +111,7 @@ export class CustomBundleHandler {
}
// Write the TypeScript output
await base64Output.writeToFile(bundleConfig.to);
await base64Output.writeToFile(bundleConfig.to, bundleConfig.maxLineLength);
}
/**