vite-plugin-macro

JSON →
library 0.2.0 ·javascript
verified Jun 4, 2026

vite-plugin-macro (v0.2.0) brings macro capabilities to Vite-based projects, allowing developers to write compile-time transformations using Babel macros. It integrates seamlessly with Vite's plugin system, enabling deferred execution, context-aware transformations, and enhanced code generation. Unlike Babel standalone approaches, this plugin is optimized for Vite's build pipeline and supports TypeScript. Due to its early stage (0.x), backward compatibility is not guaranteed. Release cadence is irregular as the project evolves. Key differentiators: Vite-native macro system with Babel under the hood, TypeScript support, and lightweight integration.