Skip to content
PluginStats

vite-plugin-vue-server-ref weekly downloads statistics

By antfu (15 listings) · npm · Vite plugins

Share state between clients and Vite server

View on npm Fresh · Dec 6, 2026

vite-plugin-vue-server-ref has 300,647 recorded weekly downloads on npm, an increase of 37.0% over the past 30 days, ranking #468 of 3,247 tracked listings.

Weekly downloads
300,647
Official API · Dec 5, 2026
7-day growth
+47.8%
+97.3K weekly downloads
30-day growth
+37.0%
+81.3K weekly downloads
90-day growth
+245%
+213.4K weekly downloads
Rank
#468
▲ 39 in 7 days

About vite-plugin-vue-server-ref

vite-plugin-vue-server-ref

NPM version

Share state between clients and Vite server.

Install

npm i -D vite-plugin-vue-server-ref

Add plugin to your vite.config.ts:

// vite.config.ts
import ServerRef from 'vite-plugin-vue-server-ref'

export default {
  plugins: [
    ServerRef({
      state: {
        /* Your custom initial state */
        foo: 'bar',
        object: {
          count: 0
        }
      }
    })
  ]
}

Use import it in your modules (server-ref:[key])

import foo from 'server-ref:foo'

console.log(foo.value) // bar

foo.value = 'foobar'

// same as other modules / clients imported the server ref with same key
// or even refresh the pages
console.log(foo.value) // foobar

Or working with reactive object (server-reactive:[key])

import object from 'server-reactive:object'

console.log(object.count) // 0

Type Support

As server import can't infer the type correctly (by default it's ServerRef<any>), you can using as to specify the type.

import type { ServerReactive, ServerRef } from 'vite-plugin-vue-server-ref/client'
import _foo from 'server-ref:foo'
import _object from 'server-ref:object'

const foo = _foo as ServerRef<string>
const object = _object as ServerReactive<{ count: number }>

foo.value // string
object.count // number

Controls

import foo from 'server-ref:foo'

foo.$syncUp = false // make it download only

foo.value = 'foobar' // won't send to server or other clients
import foo from 'server-ref:foo'

foo.$syncDown = false // make it upload only

// changes from other clients won't be received
import foo from 'server-ref:foo'

// listen to server change
foo.$onSet((value) => {
  console.log(`Changes from server: ${value}`)
})

Diffing

When working with reactive objects, you can add ?diff to make the syncing incremental (deep diff).

import object from 'server-ref:object?diff'

console.log(object) // { foo: ..., bar: ... }

object.foo.nested = 'bar'
// the patch will be sent as '{ foo: { nested: 'bar' }}}'
// instead of the entire object

Sponsors

<p align="center"> <a href="https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg"> <img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'/> </a> </p>

License

MIT License © 2021 Anthony Fu

Description from the npm listing.

  • vite-plugin

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

vite-plugin-vue-server-ref weekly downloads on npm, last 90 days: 300,647 weekly downloads as of Dec 5, 2026, +245% over 90 days.vite-plugin-vue-server-refWeekly downloads on npm · Last 90 days300,647downloads / week+245% over 90 days050K100K150K200K250K300K350KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
vite-plugin-vue-server-ref weekly downloads on npm, last 90 days: 300,647 weekly downloads as of Dec 5, 2026, +245% over 90 days.

7/30/90-day growth

vite-plugin-vue-server-ref weekly downloads growth on npm: +47.8% over 7 days, +37.0% over 30 days, +245% over 90 days.vite-plugin-vue-server-refWeekly downloads growth on npm300,647downloads / week now7-day growth+97,264 weekly downloads+47.8%30-day growth+81,268 weekly downloads+37.0%90-day growth+213,447 weekly downloads+245%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
vite-plugin-vue-server-ref weekly downloads growth on npm: +47.8% over 7 days, +37.0% over 30 days, +245% over 90 days.

Ranking history

vite-plugin-vue-server-ref npm ranking history: currently #468 (by weekly downloads).vite-plugin-vue-server-refnpm ranking · by weekly downloads · Last 90 days#468current rank#440#460#480#500#520#540#560Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
vite-plugin-vue-server-ref npm ranking history: currently #468 (by weekly downloads).

Listing placement

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

Listing placement

Vite plugins300 listings · 15 pages · page 4, #13 (overall #73)
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 vite-plugin-vue-server-ref
Date (UTC)Weekly downloadsChange vs. previous
300,647+18.9K
281,785+23.7K
258,109+21K
237,138+21.5K
215,629+9.2K
206,448+4.3K
202,102-1.3K
203,383-2K
205,420-20.7K
226,085-17.5K
243,549-17.3K
260,880-24.4K
285,305-9.1K
294,411—

Similar npm Vite plugins plugins

All 20 vite-plugin-vue-server-ref 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/vite-plugin-vue-server-ref. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.