What problem does it solve?
Writing Rolldown plugins correctly requires navigating hook contracts, module graph timing, virtual module identity, and output ownership rules that are easy to get wrong. This Skill guides the implementation of Rolldown plugins that integrate cleanly with the host build graph instead of fighting it.
Core Features & Use Cases
- Hook Selection Guidance: Choose between
transform, renderChunk, resolveId, load, and other hooks based on whether the edit concerns source modules or final chunks.
- Virtual Module & Graph Rules: Enforce private
\0-prefixed virtual IDs, correct moduleType returns, namespaced module meta, and proper watch-file registration.
- Output Ownership & Testing: Emit assets and chunks via
this.emitFile without destroying unrelated output, and validate through real Rolldown builds plus host-compatibility tests.
- Use Case: When asked to build a plugin that publishes transformed component metadata as JSON, produce a plugin that loads components through the host graph, retains namespaced metadata, watches discovery inputs, and emits JSON assets with direct Rolldown and Vite compatibility tests.
Quick Start
Create a Rolldown plugin that transforms component source files and emits the collected metadata as a JSON asset in the build output.