PledgePack Bundler
The Rust + Zig bundler and dev server that powers PledgeJS.
TL;DR
PledgePack is the default bundler and dev server for PledgeJS, written in Rust and Zig. It uses Oxc for transforms, Lightning CSS for styles, and a Zig C ABI for hot-path file I/O. It replaces Vite, webpack, and Rollup with a single native toolchain.
Last updated: August 22, 2026
Architecture
PledgePack is a Rust + Zig bundler and dev server. It uses Oxc for transforms, Lightning CSS for styles, Axum for the dev server, and a Zig C ABI for hot-path file I/O and SIMD scanning. The Rust orchestrator handles the engine, resolver, cache, dev server, optimizer, and JS plugin host. The Zig layer handles file I/O, module graph, SIMD scanning, hashing, and memory-mapped I/O.
Project Structure
PledgePack is organized as a Rust workspace with a Zig native library.
pledgepack/
├── Cargo.toml # Rust workspace
├── build.zig # Zig build script
├── package.json # npm package (bin: pledgepack, pledge)
├── native-sys/ # Rust FFI bindings to Zig
│ └── zig/ # Zig native library
│ ├── io.zig # File I/O (mmap, thread pool)
│ ├── graph.zig # Arena-allocated module graph
│ └── simd.zig # SIMD source scanning
├── crates/
│ ├── cli/ # CLI entry point (binary: pledge)
│ ├── core/ # Engine, config, transform pipeline
│ ├── cache/ # Function-level incremental cache
│ ├── resolver/ # Module resolution
│ ├── dev-server/ # Dev server + HMR + error overlay
│ ├── optimizer/ # Tree shaking, code splitting
│ ├── js-plugin-host/ # Vite-compatible JS plugin API (QuickJS)
│ ├── wasm-plugin-host/ # WebAssembly plugin host
│ ├── adapter-react/ # React JSX + Fast Refresh
│ ├── adapter-solid/ # Solid.js JSX adapter
│ ├── adapter-next/ # Next.js adapter
│ ├── adapter-tanstack/ # TanStack Router adapter
│ ├── adapter-pledgestack/ # PledgeStack adapter
│ └── task-system/ # Parallel task execution engine
└── docs/Prerequisites
Building PledgePack from source requires Rust (stable, edition 2024) and Zig (0.14.0+).
git clone https://github.com/pledgeandgrow/pledgepack
cd pledgepack
# Build Zig native library
zig build -Doptimize=ReleaseFast
# Build Rust
cargo build --releaseTransform Pipeline
The transform pipeline lives in crates/core/src/transform/ and is split into focused submodules.
js.rs — JS/TS/JSX via Oxc, React Fast Refresh, dynamic import detectioncss.rs — Lightning CSS, CSS Modules, PostCSS/Tailwind, Sass/SCSSassets.rs — JSON, static assets, WASM, shaderssfc.rs — Vue, Svelte, Astro Single-File Componentsenv.rs — Environment variables, define, import.meta.globdata.rs — MDX, GraphQL, YAML, CSV, TSV, TOMLutils.rs — Source maps, Web Worker import transforms