Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/konhi/elevenlabs-speech-to-text-api-ui/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The project uses Bun’s native build system with a custom build script (build.ts) that processes HTML entrypoints and bundles all assets for production.

Build Configuration

The build process is configured in build.ts:125-136 with the following defaults:
const result = await Bun.build({
  entrypoints,
  outdir,
  plugins: [plugin],
  minify: true,
  target: "browser",
  sourcemap: "linked",
  define: {
    "process.env.NODE_ENV": JSON.stringify("production"),
  },
});

Default Settings

  • Output Directory: dist/
  • Minification: Enabled
  • Target: Browser
  • Sourcemaps: Linked (external .map files)
  • Plugins: Tailwind CSS plugin (bun-plugin-tailwind)
  • Entrypoints: All .html files in src/ directory

Building for Production

1

Run the build command

bun run build
This executes the build.ts script which:
  1. Cleans the previous dist/ directory
  2. Scans for all HTML entrypoints in src/
  3. Bundles JavaScript, CSS, and processes Tailwind
  4. Outputs minified files to dist/
2

Verify build output

The build script displays a table showing all generated files:
📄 Found 1 HTML file to process

┌─────────┬──────────────────┬──────────┬──────────┐
│ (index) │ File             │ Type     │ Size     │
├─────────┼──────────────────┼──────────┼──────────┤
│ 0       │ dist/index.html  │ entry    │ 45.23 KB │
│ 1       │ dist/index.js    │ chunk    │ 234.12 KB│
│ 2       │ dist/index.css   │ asset    │ 12.45 KB │
└─────────┴──────────────────┴──────────┴──────────┘

✅ Build completed in 142.34ms
3

Deploy the dist folder

The entire dist/ directory contains your production-ready application. Deploy this folder to your hosting platform.

Build Options

The build script accepts command-line arguments to customize the build process. View all available options:
bun run build.ts --help

Common Build Options

bun run build.ts --outdir=public

Available Options

OptionDescriptionDefault
--outdir <path>Output directorydist
--minifyEnable minificationtrue
--sourcemap <type>Sourcemap type (none|linked|inline|external)linked
--target <target>Build target (browser|bun|node)browser
--format <format>Output format (esm|cjs|iife)-
--splittingEnable code splitting-
--external <list>External packages (comma separated)-
--public-path <path>Public path for assets-

Production Server

After building, you can run the production server:
bun run start
This executes: NODE_ENV=production bun src/index.ts The production server:
  • Serves static files from the dist/ directory
  • Runs in production mode for optimized performance
  • Uses Bun’s built-in HTTP server

Development vs Production

bun run dev
# Starts dev server with hot reload
# Command: bun --hot src/index.ts

Build Output Structure

After running bun run build, your dist/ directory will contain:
dist/
├── index.html       # Main HTML file
├── index.js         # Bundled JavaScript (minified)
├── index.js.map     # Source map
└── index.css        # Bundled CSS with Tailwind (minified)

Troubleshooting

Build Fails

If the build fails, ensure:
  • All dependencies are installed: bun install
  • You’re using Bun version 1.x or higher: bun --version
  • The src/ directory contains valid HTML entrypoints

Large Bundle Size

To reduce bundle size:
bun run build.ts --minify --external=react,react-dom

Missing Sourcemaps

To disable sourcemaps for smaller builds:
bun run build.ts --sourcemap=none

Build docs developers (and LLMs) love