Skip to content
PluginStats

@roots/vite-plugin weekly downloads statistics

By roots · npm · Vite plugins

A Vite plugin for working with WordPress.

View on npm Fresh · Dec 6, 2026

@roots/vite-plugin has 14,812 recorded weekly downloads on npm, an increase of 15.3% over the past 30 days, ranking #1140 of 3,247 tracked listings.

Weekly downloads
14,812
Official API · Dec 5, 2026
7-day growth
+12.9%
+1.7K weekly downloads
30-day growth
+15.3%
+2K weekly downloads
90-day growth
+105%
+7.6K weekly downloads
Rank
#1140
▲ 18 in 7 days

About @roots/vite-plugin

Vite Plugin for WordPress

<a href="https://www.npmjs.com/package/@roots/vite-plugin"><img alt="npm version" src="https://img.shields.io/npm/v/@roots/vite-plugin.svg?color=%23525ddc&style=flat-square"></a> <a href="https://www.npmjs.com/package/@roots/vite-plugin"><img alt="npm downloads" src="https://img.shields.io/npm/dt/@roots/vite-plugin?label=downloads&colorB=2b3072&colorA=525ddc&style=flat-square"></a> <a href="https://github.com/roots/vite-plugin/actions/workflows/tests.yml"><img alt="Build Status" src="https://img.shields.io/github/actions/workflow/status/roots/vite-plugin/tests.yml?color=%23525ddc&style=flat-square"></a> <a href="https://twitter.com/rootswp"><img alt="Follow Roots" src="https://img.shields.io/badge/follow%20@rootswp-1da1f2?logo=twitter&logoColor=ffffff&message=&style=flat-square"></a> <a href="https://github.com/sponsors/roots"><img src="https://img.shields.io/badge/sponsor%20roots-525ddc?logo=github&style=flat-square&logoColor=ffffff&message=" alt="Sponsor Roots"></a>

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

npm install @roots/vite-plugin --save-dev

Usage

Start by adding the base plugin to your Vite config:

// vite.config.js
import { defineConfig } from "vite";
import { wordpressPlugin } from "@roots/vite-plugin";

export default defineConfig({
  plugins: [wordpressPlugin()],
});

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.

JSX compiles to wp.element.createElement, so components render with WordPress's React. Imports of react, react-dom, and react/jsx-runtime, including those inside packages like @wordpress/dataviews, use WordPress's React when its react, react-dom, and react-jsx-runtime scripts are on the page (they're listed in editor.deps.json) and fall back to the bundled copy otherwise. To bundle your own React and JSX runtime instead, set jsx: false.

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.

// vite.config.js
import { defineConfig } from "vite";
import { wordpressPlugin } from "@roots/vite-plugin";

export default defineConfig({
  plugins: [
    wordpressPlugin({
      externalMappings: {
        "acf-input": {
          global: ["acf", "input"],
          handle: "acf-input",
        },
        "woocommerce-blocks": {
          global: ["wc", "blocks"],
          handle: "wc-blocks",
        },
      },
    }),
  ],
});

With this configuration, you can import from these packages in your code:

import { Field, FieldGroup } from "acf-input";
import { registerBlockType } from "woocommerce-blocks";

The plugin will transform these imports into global references:

const Field = acf.input.Field;
const FieldGroup = acf.input.FieldGroup;
const registerBlockType = wc.blocks.registerBlockType;

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:

// vite.config.js
import { defineConfig } from "vite";
import { wordpressPlugin } from "@roots/vite-plugin";

export default defineConfig({
  plugins: [
    wordpressPlugin({
      hmr: {
        // Enable/disable HMR (default: true)
        enabled: true,

        // Pattern to match editor entry points (default: /editor/)
        editorPattern: /editor/,

        // Name of the editor iframe element (default: 'editor-canvas')
        iframeName: "editor-canvas",
      },
    }),
  ],
});
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:

// vite.config.js
import { defineConfig } from "vite";
import { wordpressThemeJson } from "@roots/vite-plugin";

export default defineConfig({
  plugins: [
    wordpressThemeJson({
      // Optional: Configure shade labels
      shadeLabels: {
        100: "Lightest",
        900: "Darkest",
      },

      // Optional: Configure font family labels
      fontLabels: {
        sans: "Sans Serif",
        mono: "Monospace",
        inter: "Inter Font",
      },

      // Optional: Configure font size labels
      fontSizeLabels: {
        sm: "Small",
        base: "Default",
        lg: "Large",
      },

      // Optional: Configure border radius labels
      borderRadiusLabels: {
        sm: "Small",
        md: "Medium",
        lg: "Large",
        full: "Full",
      },…

Description from the npm listing.

  • vite
  • vite-plugin
  • wordpress

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

@roots/vite-plugin weekly downloads on npm, last 90 days: 14,812 weekly downloads as of Dec 5, 2026, +105% over 90 days.@roots/vite-pluginWeekly downloads on npm · Last 90 days14,812downloads / week+105% over 90 days02K4K6K8K10K12K14K16KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@roots/vite-plugin weekly downloads on npm, last 90 days: 14,812 weekly downloads as of Dec 5, 2026, +105% over 90 days.

7/30/90-day growth

@roots/vite-plugin weekly downloads growth on npm: +12.9% over 7 days, +15.3% over 30 days, +105% over 90 days.@roots/vite-pluginWeekly downloads growth on npm14,812downloads / week now7-day growth+1,692 weekly downloads+12.9%30-day growth+1,966 weekly downloads+15.3%90-day growth+7,576 weekly downloads+105%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@roots/vite-plugin weekly downloads growth on npm: +12.9% over 7 days, +15.3% over 30 days, +105% over 90 days.

Ranking history

@roots/vite-plugin npm ranking history: currently #1140 (by weekly downloads).@roots/vite-pluginnpm ranking · by weekly downloads · Last 90 days#1140current rank#1040#1060#1080#1100#1120#1140#1160#1180#1200Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
@roots/vite-plugin npm ranking history: currently #1140 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 57, #20 (overall #1,140)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins300 listings · 15 pages · page 10, #17 (overall #197)
Vite plugins: every listing in weekly downloads order

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.

Each band is one page of 20. Weekly downloads on a linear 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.

Recent observations

Full history (170)
Recent weekly downloads observations for @roots/vite-plugin
Date (UTC)Weekly downloadsChange vs. previous
14,812+298
14,514+87
14,427-57
14,484+583
13,901+288
13,613+369
13,244+124
13,120-210
13,330-272
13,602-134
13,736-359
14,095+474
13,621+149
13,472—

Similar npm Vite plugins plugins

All 20 @roots/vite-plugin alternatives

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 Dec 6, 2026. See the methodology.