55 releases
Uses new Rust 2024
| new 0.1.0-alpha.2 | Jan 4, 2026 |
|---|---|
| 0.1.0-alpha.1 | Dec 21, 2025 |
| 0.0.111 | Oct 3, 2025 |
| 0.0.109 | Sep 20, 2025 |
| 0.0.71 | Jun 25, 2025 |
#20 in #file-watching
Used in 2 crates
27KB
202 lines
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
- Copy shared modules to source scripts directory
- Bundle with Rolldown (minified, with source maps)
- Update
index.htmlwith hashed script references - Inject version into service worker
Dependencies
~46–82MB
~1.5M SLoC