PART 02
Bundler evolution
From the esbuild + Rollup dual-engine legacy to Rolldown — handoff and compatibility layer.
- 2.1The Dual-Engine Legacy: esbuild + RollupWhy did Vite originally choose esbuild for dev and Rollup for build? What structural problems did this "good design" introduce? Understanding the history is the key to understanding why Rolldown was inevitable.
- 2.2What Is RolldownA next-generation JavaScript bundler written in Rust — why rebuild from scratch? What is Rolldown's relationship to Rollup? What are its design goals?
- 2.3Rolldown Architecture Deep DiveHow does Rolldown work internally? What do the three stages — OXC parsing, module graph construction, and chunk generation — each do? Where do the architectural differences with Rollup lie?
- 2.4Plugin API Compatibility LayerHow does Rolldown achieve backward compatibility with Rollup plugins? Which hooks are fully compatible? Which have subtle differences? What do you need to watch out for when migrating Vite 7 plugins?
- 2.5In Practice: Writing Cross-Bundler Compatible PluginsUsing the code from example project 5, implement a plugin that runs correctly on both Rollup and Rolldown — full coverage of compatibility strategies, runtime detection, and testing methods.