8 unstable releases (3 breaking)
Uses new Rust 2024
| 0.5.0 | Dec 29, 2025 |
|---|---|
| 0.4.2 | Dec 11, 2025 |
| 0.3.0 | Dec 1, 2025 |
| 0.2.4 | Dec 1, 2025 |
| 0.2.2 | Nov 29, 2025 |
#1412 in Filesystem
Used in 5 crates
1MB
18K
SLoC
fob-bundler
Fob bundler - Rolldown-based bundling on top of fob foundation.
This crate provides full bundling capabilities using Rolldown, building on top
of the fob foundation crate for graph analysis and runtime abstraction.
Quick Start
Bundle a library
use fob_bundler as fob;
let result = fob::BuildOptions::new("./src/index.js")
.platform(fob::Platform::Node) // Uses Node.js export conditions
.externalize(["react", "react-dom"])
.sourcemap(true)
.build()
.await?;
let bundle = result.output.as_single().expect("single bundle");
for asset in bundle.assets.iter() {
std::fs::write(format!("dist/{}", asset.filename()), asset.content_as_bytes())?;
}
Using BuildConfig (Recommended for New Code)
BuildConfig provides a cleaner API with better type safety:
use fob_bundler::BuildConfig;
let result = BuildConfig::new("./src/index.js")
.bundle(false)
.output_dir("dist")
.build()
.await?;
result.write_to("dist", true)?;
Analyze without bundling
use fob_bundler as fob;
let analysis = fob_graph::analyze(["./src/index.js"]).await?;
for unused in analysis.graph.unused_exports()? {
println!("unused: {} from {}", unused.export.name, unused.module_id);
}
Dependencies
~57–86MB
~1.5M SLoC