What problem does it solve?
Writing Vite plugins requires choosing between Rolldown and Vite plugin APIs, managing hook ordering, environment lifecycles, and serve/build activation, and mistakes lead to subtle build or dev-server bugs.
Core Features & Use Cases
- Plugin Architecture Guidance: Classify requirements to decide between a raw Rolldown plugin,
build.rolldownOptions.plugins, or a top-level Vite plugin.
- Lifecycle and Ordering Rules: Apply
enforce, per-hook order, apply gating, and environment-aware state management correctly.
- Testing Strategy: Cover direct Rolldown tests, programmatic Vite serve/build tests, and worker or multi-environment scenarios.
- Use Case: When asked to make a source transform available in Vite with rebuild-on-config-change, produce a host-generic Rolldown transform wrapped in a thin Vite adapter with explicit activation and tests.
Quick Start
Create a Vite plugin that transforms my source files and rebuilds when its configuration changes.