Tinybuild

raw JSON →
1.0.5 verified Fri May 01 auth: no javascript

A minimal esbuild wrapper for web, server, desktop, and mobile development with hot-reloading and multi-target builds. Current stable version is 1.0.5, released with low cadence. Key differentiators: zero-config scaffolding, built-in Node.js dev server with HMR via WebSockets, native Electron/Tauri/Capacitor packaging, remote import resolution, and optional Python Quart bridge. Unlike Vite or Webpack, it avoids third-party plugin churn and uses plain JS config with intuitive flags. Peer dependency on TypeScript.

error Error [ERR_REQUIRE_ESM]: require() of ES Module ...\node_modules\tinybuild\index.js from ...\project\build.js not supported.
cause Using CommonJS require() with an ESM-only package since version 1.0.0
fix
Convert to ESM (import/export) or use dynamic import() as fallback
error TypeError: tinybuild is not a function
cause Default import used with CommonJS require() or wrong import syntax
fix
Use 'import tinybuild from 'tinybuild'' for default export
error Failed to resolve 'chokidar' dependency for hot-reload
cause chokidar is an optional peer dependency not auto-installed
fix
Run 'npm install chokidar' manually
breaking Version 1.0.0 removed CommonJS support; require() will throw ERR_REQUIRE_ESM
fix Use ESM imports (import { ... } from 'tinybuild') or set type: 'module' in package.json
deprecated The 'serve' flag is deprecated in favor of 'dev' flag since 1.0.3
fix Replace --serve with --dev in CLI or dev: true in config
gotcha If using TypeScript, peer dependency must be installed separately (typescript not bundled)
fix Run 'npm install typescript --save-dev' if not already installed
gotcha Hot-reload server uses WebSocket; ensure no firewall blocks port 35729 (default)
fix Set a custom port via --port flag or port config option
gotcha Remote imports (https://...) require network access; offline builds will fail
fix Pre-download dependencies or use --no-remote flag
npm install tinybuild
yarn add tinybuild
pnpm add tinybuild

Shows programmatic usage of tinybuild with TypeScript, enabling browser bundling and dev server

import tinybuild from 'tinybuild';

// Build a browser bundle with HMR dev server
const result = await tinybuild({
  bundleBrowser: true,
  entry: 'src/index.ts',
  dev: true,
  // Optional: target output directory
  output: 'dist/',
  // Optional: TypeScript config
  tsconfig: 'tsconfig.json'
});

console.log('Build succeeded:', result);