@roots/vite-plugin weekly downloads statistics
By roots · npm · Vite plugins
A Vite plugin for working with WordPress.
@roots/vite-plugin has 5,335 recorded weekly downloads on npm, a decrease of 28.8% over the past 30 days.
It ranks #1079 of 2,256 tracked npm listings by weekly downloads.
Over 90 days, weekly downloads changed by -36.4%.
PluginStats has 121 daily observations since Jun 19, 2026; the latest is from Oct 17, 2026.
About @roots/vite-plugin
Vite Plugin for WordPress
Here lives a Vite plugin for WordPress development.
Support us
Roots is an independent open source org, supported only by developers like you. Your sponsorship funds WP Packages and the entire Roots ecosystem, and keeps them independent. Support us by purchasing Radicle or sponsoring us on GitHub — sponsors get access to our private Discord.
Features
• 🔄 Transforms @wordpress/* imports into global wp.* references • 📦 Generates dependency manifest for WordPress enqueuing • 🎨 Generates theme.json from Tailwind CSS configuration (colors, fonts, font sizes, border radius) • 🔥 Hot Module Replacement (HMR) support for the WordPress editor
Installation
Usage
Start by adding the base plugin to your Vite config:
Once you've added the plugin, WordPress dependencies referenced in your code will be transformed into global wp.* references.
When WordPress dependencies are transformed, a manifest containing the required dependencies will be generated called editor.deps.json.
External Mappings for Third-Party Plugins
The plugin can also handle third-party WordPress plugins that expose global JavaScript APIs, such as Advanced Custom Fields (ACF) or WooCommerce. This allows you to import these dependencies in your code while ensuring they're treated as external dependencies and properly enqueued by WordPress.
With this configuration, you can import from these packages in your code:
The plugin will transform these imports into global references:
The handle value is added to the dependency manifest (editor.deps.json) so WordPress knows to enqueue these scripts before your code runs.
Editor HMR Support
The plugin automatically enables CSS Hot Module Replacement (HMR) for the WordPress editor.
[!NOTE] JavaScript HMR is not supported at this time. JS changes will trigger a full page reload.
You can customize the HMR behavior in your Vite config:
Theme.json Generation
When using this plugin for theme development, you have the option of generating a theme.json file from your Tailwind CSS configuration.
To enable this feature, add the wordpressThemeJson plugin to your Vite config:
Partials
The plugin automatically discovers *.theme.js files in the resources/ directory and deep merges them into the generated theme.json. This lets you split your theme styles across multiple files — for example, co-locating block styles with their block templates.
Partials support two export formats:
Shorthand — blocks and elements at the top level are merged into styles:
Full — merged at the root level, allowing you to target any part of theme.json:
Files are merged in alphabetical order by path. During development, changes to .theme.js files will trigger a rebuild.
You can customize the directory to scan, pass multiple directories, or disable partials entirely:
Tailwind CSS Variables
By default, Tailwind v4 will only generate CSS variables that are discovered in your source files.
To generate the full default Tailwind color palette into your theme.json, you can use the static theme option when importing Tailwind:
The same applies for customized colors in the @theme directive. To ensure your colors get generated, you can use another form of the static theme option:
Community
Keep track of development and community news.
• Join us on Discord by sponsoring us on GitHub • Join us on Roots Discourse • Follow @rootswp on Twitter • Follow the Roots Blog • Subscribe to the Roots Newsletter
Description from the npm listing.
- vite
- vite-plugin
- wordpress
Where @roots/vite-plugin sits in the listing
Each band is one page of 20. Weekly downloads on a log scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Recent observations
Full history (121)Similar npm Vite plugins plugins
Data source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@roots/vite-plugin. First seen Oct 16, 2026; last successful collection Oct 19, 2026. See the methodology.