brk_bundler

Crates.iobrk_bundler
lib.rsbrk_bundler
version0.1.0-alpha.2
created_at2025-06-14 23:51:05.150999+00
updated_at2026-01-04 10:59:29.326733+00
descriptionA thin wrapper around rolldown
homepagehttps://bitcoinresearchkit.org
repositoryhttps://github.com/bitcoinresearchkit/brk
max_upload_size
id1712755
size101,075
(nym21)

documentation

README

brk_bundler

JavaScript bundling with watch mode for BRK web interfaces.

What It Enables

Bundle and minify JavaScript modules using Rolldown, with file watching for development. Handles module copying, source map generation, and cache-busting via hashed filenames.

Key Features

  • Rolldown integration: Fast Rust-based bundler with tree-shaking and minification
  • Watch mode: Rebuilds on file changes with live module syncing
  • Source maps: Full debugging support in production builds
  • Cache busting: Hashes main bundle filename, updates HTML references automatically
  • Service worker versioning: Injects package version into service worker files

Core API

// One-shot build
let dist = bundle(modules_path, websites_path, "src", false).await?;

// Watch mode for development
bundle(modules_path, websites_path, "src", true).await?;

Build Pipeline

  1. Copy shared modules to source scripts directory
  2. Bundle with Rolldown (minified, with source maps)
  3. Update index.html with hashed script references
  4. Inject version into service worker
Commit count: 1045

cargo fmt