Skip to content

Build configuration and binary optimization #11778

Closed as not planned
Closed as not planned

Description

@randomm

Parent Epic

Part of #11762 (Ink-based TUI Rewrite)

Objective

Configure the build system for the Ink-based TUI, optimize bundle size, and create distribution binary.

Tasks

Build Configuration

  • Create/update src/cli/ink/index.tsx as entry point
  • Update script/build-lite.ts for Ink build (or create new script)
  • Configure TypeScript for JSX/TSX
  • Ensure React JSX transform is configured
  • Tree-shaking configuration for minimal bundle

Bundle Size Analysis

  • Measure baseline bundle size (before Ink)
  • Measure after adding Ink + React
  • Identify large dependencies
  • Consider dynamic imports for optional features

Binary Creation

  • Verify bun build --compile works with Ink
  • Test binary on clean system
  • Measure final binary size (target: < 15MB)

Configuration

// tsconfig additions for JSX
{
  "compilerOptions": {
    "jsx": "react-jsx",
    "jsxImportSource": "react"
  }
}

Build Script

// script/build-ink.ts
await Bun.build({
  entrypoints: ['./src/cli/ink/index.tsx'],
  outdir: './dist',
  target: 'bun',
  minify: true,
  // ...
})

Size Targets

Component Target Notes
Ink + React < 500KB After tree-shaking
Yoga (layout) ~200KB Core of Ink
Application code < 100KB Our components
Total bundle < 1MB Before Bun compile
Final binary < 15MB After Bun compile

Acceptance Criteria

  • Build completes without errors
  • Binary runs on target platforms
  • Binary size < 15MB
  • No runtime dependency issues
  • Build time reasonable (< 30s)

Estimated Effort

1 day

Risk

Medium - Bun compile with React/Ink may have quirks

Dependencies

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Feb 2, 2026
  2. randomm commented on Feb 3, 2026

    @randomm
    Author

    Reopening - Phase 1 & 2 components merged successfully. Proceeding with build optimization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

opentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions