CodeVetter · Repo Unpack · Extension points
rolldown/rolldown
Plugins are the principal extension mechanism across JavaScript and Rust. Hook adapters preserve metadata and filters across the language boundary, while factories manage state lifetime. Additional APIs expose compiler utilities and experimental dev callbacks. CLI options derive from schema information rather than a standalone hand-maintained command inventory.
- JavaScript options hooks execute in pre/normal/post order and can replace input options; outputOptions hooks synchronously apply the same ordering model to output settings.
- bindingifyPlugin adapts build, output, and watch hook families; resolveId, transform, load, and renderChunk adapters return filter information alongside hook metadata.
- Rust plugins implement Plugin: Any + Debug + Send + Sync + 'static, provide a name, and optionally override default no-op/None build_start, resolve_id, load, transform, and module_parsed hooks.
- Builtin TypeScript factories construct named BuiltinPlugin descriptors; examples include import-glob, dynamic-import-vars, JSON, and resolver helpers, with some made callable through makeBuiltinPluginCallable.
- Parallel plugin descriptors carry index/fileUrl/options into a shared registry and up to eight workers; workers import implementations, instantiate per-thread plugins, and register adapted callbacks.
- CLI option registration iterates schemaInfo and alias metadata, skips never-typed entries, supports required/optional values, and registers a default variadic input command accepting unknown options for later warnings.
- Bundle is generic over a cloneable FileSystem and delegates source reads/writes through that interface; plugin-backed virtual inputs provide another integration route, demonstrated by the browser smoke test.
- DevEngine.create converts caller callbacks for HMR, full output, and additional assets into binding callbacks and supplies watch/rebuild controls; this is an inspected integration boundary for hosting development behavior.