Registry / web-framework / rebuildjs

rebuildjs

JSON →
library0.71.1jsnpmunverified

rebuildjs is a reactive esbuild-based build tool and development server for multi-page apps (MPAs), offering a simple, hackable alternative to Vite. It provides functions for both dev (with file watching, incremental builds, and a built-in HTTP server) and production builds. Currently at v0.71.1, it is actively developed with frequent releases. Key differentiators: full MPA focus, minimal configuration, and integration with `rmemo` for reactive state. Types are included. Requires `esbuild` as a peer dependency. The companion server framework `relysjs` (ElysiaJS-based) ties it together for app server usage.

npm install rebuildjs
INSTALL
IMPORT
SIG · REBUILDJS
R
rebuildjs
web-frameworkjavascriptv0.71.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

rebuildDev
import { rebuildDev } from 'rebuildjs'
const rebuildDev = require('rebuildjs').rebuildDev
ESM only; no CJS support.
rebuild
import { rebuild } from 'rebuildjs'
import rebuild from 'rebuildjs'
Named export, not default.
bundles
import { bundles } from 'rebuildjs'
For production bundles.
default
import rebuildjs from 'rebuildjs'
import { default as rebuildjs } from 'rebuildjs'
Default export is the module itself; rarely used.

Sets up a dev server with file watching, incremental builds, and logging for a multi-page app.

import { rebuildDev } from 'rebuildjs' const PORT = process.env.PORT ?? 3000 const HOST = process.env.HOST ?? 'localhost' const entry = ['src/index.ts'] async function start() { const { server, close } = await rebuildDev({ entryPoints: entry, outdir: 'dist', port: PORT, host: HOST, onRequest: (req) => console.log(`${req.method} ${req.url}`) }) console.log(`Dev server running at http://${HOST}:${PORT}`) } start()
rebuildjs --version
Debug
Known issues
gotchaESbuild ^0.27.3 required; older versions may cause build failures.
fix
Update esbuild to ^0.27.3.
affects: <0.27.3
breakingThe `rebuildDev` function no longer returns the `watcher` object directly; access via returned object instead.
fix
Use destructured `{ server, close }` or check changelog for migration.
affects: >=0.70.0
deprecated`rebuildWatch` is deprecated; use `rebuildDev` with `watch: true` instead.
fix
Replace `rebuildWatch` with `rebuildDev`.
affects: >=0.71.0
gotchaCJS `require` will not work; package is ESM-only.
fix
Use `import` or run in an ESM project.
affects: >=0.50.0
Errors
Common errors & fixes
Error: Cannot find module 'esbuild'
Missing peer dependency esbuild.
fix
Install esbuild: npm install esbuild
TypeError: (0 , rebuildjs.rebuildDev) is not a function
Using `require` instead of `import` (CJS vs ESM).
fix
Switch to ESM import: import { rebuildDev } from 'rebuildjs'
Build failed: unexpected version of esbuild
Incompatible esbuild version installed.
fix
Update esbuild to ^0.27.3
Upgrade
Version history
0.71.1latest on npm
Audit
Dependencies
esbuildrequiredPeer dependency for core bundling functionality
Agent activity
4 hits · last 30 days
node
4
Resources
rebuildjs — npm install rebuildjs · libregistry