Skip to content
PluginStats

vite-ssg weekly downloads statistics

By antfu-collective (2 listings) · npm · Vite plugins

Server-side generation for Vite

View on npm Fresh · Oct 18, 2026

vite-ssg has 29,825 recorded weekly downloads on npm, a decrease of 33.7% over the past 30 days, ranking #694 of 2,322 tracked listings.

Weekly downloads
29,825
Official API · Oct 18, 2026
7-day growth
-50.2%
-30K weekly downloads
30-day growth
-33.7%
-15.2K weekly downloads
90-day growth
-33.5%
-15K weekly downloads
Rank
#694
Among tracked npm listings

About vite-ssg

Vite SSG

Static-site generation for Vue 3 on Vite.

NPM version

ℹ️ ESM-only from v27.0.0 (CJS generation format also dropped).

ℹ️ Vite 2 is supported from v0.2.x, Vite 1's support is discontinued.

Install

This library requires Node.js version >= 14

<pre> <b>npm i -D vite-ssg</b> <em>vue-router @unhead/vue</em> </pre>
// package.json
{
  "scripts": {
    "dev": "vite",
-   "build": "vite build"
+   "build": "vite-ssg build"

    // OR if you want to use another vite config file
+   "build": "vite-ssg build -c another-vite.config.ts"
  }
}
// src/main.ts
import { ViteSSG } from 'vite-ssg'
import App from './App.vue'

// `export const createApp` is required instead of the original `createApp(App).mount('#app')`
export const createApp = ViteSSG(
  // the root component
  App,
  // vue-router options
  { routes },
  // function to have custom setups
  ({ app, router, routes, isClient, initialState }) => {
    // install plugins etc.
  },
)
How to allow Rollup tree-shake your client code

In order to allow Rollup tree-shake your client code at build time, you need to wrap your code using import.meta.env.SSR, that's, checking if the build is for the server: Rollup will remove the server code from the client build.

if (import.meta.env.SSR) {
  // your server code will be removed in the client build
}
else {
  // your client code will be removed in the server build
}
Single Page SSG

For SSG of an index page only (i.e. without vue-router); import vite-ssg/single-page instead, and only install @unhead/vue (npm i -D vite-ssg @unhead/vue).

// src/main.ts
import { ViteSSG } from 'vite-ssg/single-page'
import App from './App.vue'

// `export const createApp` is required instead of the original `createApp(App).mount('#app')`
export const createApp = ViteSSG(App)
<ClientOnly/>

The ClientOnly component is registered globally when the app is created.

<client-only>
  <your-client-side-components />
  <template #placeholder>
    <your-placeholder-components />
  </template>
</client-only>

Document head

We ship @unhead/vue v2 to manage the document-head out of the box. You can use it directly in your pages/components. For example:

<template>
  <button @click="count++">Click</button>
</template>

<script setup>
import { useHead } from '@unhead/vue'

useHead({
  title: 'Website Title',
  meta: [
    {
      name: 'description',
      content: 'Website description',
    },
  ],
})
</script>

That's all! No configuration is needed. Vite SSG will automatically handle the server-side rendering and merging.

See @unhead/vue v2's docs for more usage information about useHead.

Critical CSS

Vite SSG has built-in support for generating Critical CSS inlined in the HTML via the beasties package. Install it with:

npm i -D beasties

Critical CSS generation will automatically be enabled for you.

To configure beasties, pass its options into ssgOptions.beastiesOptions in vite.config.ts:

// vite.config.ts
export default defineConfig({
  ssgOptions: {
    beastiesOptions: {
      // E.g., change the preload strategy
      preload: 'media',
      // Other options: https://github.com/danielroe/beasties#usage
    },
  },
})

Initial State

The initial state comprises data that is serialized with your server-side generated HTML and is hydrated in the browser when accessed. This data can be data fetched from a CDN, an API, etc, and is typically needed as soon as the application starts or is accessed for the first time.

The main advantage of setting the application's initial state is that the statically generated pages do not need to refetch the data as it is fetched and serialized into the page's HTML at build time.

The initial state is a plain JavaScript object that can be set during SSR. I.e. when statically generating the pages like this:

// src/main.ts

// ...

export const createApp = ViteSSG(
  App,
  { routes },
  ({ app, router, routes, isClient, initialState }) => {
    // ...

    if (import.meta.env.SSR) {
      // Set initial state during server side
      initialState.data = { cats: 2, dogs: 3 }
    }
    else {
      // Restore or read the initial state on the client side in the browser
      console.log(initialState.data) // => { cats: 2, dogs: 3 }
    }

    // ...
  },
)

Typically, you will use this with an application store, such as Vuex or Pinia. See below for examples:

<details><summary>When using Pinia</summary>

Following Pinia's guide, you will to adapt your main.{ts,js} file to look like this:

import { createPinia } from 'pinia'
import routes from 'virtual:generated-pages'
// main.ts
import { ViteSSG } from 'vite-ssg'

import App from './App.vue'
// use any store you configured that you need data from on start-up
import { useRootStore } from './store/root'

export const createApp = ViteSSG(
  App,
  { routes },
  ({ app, router, initialState }) => {
    const pinia = createPinia()
    app.use(pinia)

    if (import.meta.env.SSR)
      initialState.pinia = pinia.state.value
    else
      pinia.state.value = initialState.pinia || {}

    router.beforeEach((to, from, next) => {
      const store = useRootStore(pinia)
      if (!store.ready)
        // perform the (user-implemented) store action to fill the store's state
        store.initialize()
      next()
    })
  },
)
</details> <details><summary>When using Vuex</summary> <p>…

Description from the npm listing.

  • vite
  • vite-plugin
  • ssg
  • ssr

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-ssg weekly downloads on npm, last 90 days: 29,825 weekly downloads as of Oct 18, 2026, -33.5% over 90 days.vite-ssgWeekly downloads on npm · Last 90 days29,825downloads / week-33.5% over 90 days20K30K40K50K60K70KJul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 18, 2026 · 89 observations · Updated Oc…pluginstats.com
vite-ssg weekly downloads on npm, last 90 days: 29,825 weekly downloads as of Oct 18, 2026, -33.5% over 90 days.

7/30/90-day growth

vite-ssg weekly downloads growth on npm: -50.2% over 7 days, -33.7% over 30 days, -33.5% over 90 days.vite-ssgWeekly downloads growth on npm29,825downloads / week now7-day growth-30,038 weekly downloads-50.2%30-day growth-15,153 weekly downloads-33.7%90-day growth-15,019 weekly downloads-33.5%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
vite-ssg weekly downloads growth on npm: -50.2% over 7 days, -33.7% over 30 days, -33.5% over 90 days.

Ranking history

vite-ssg npm ranking history: currently #694 (by weekly downloads).vite-ssgnpm ranking · by weekly downloads · Last 90 days#694current rank#692#693#694#695#696#697#698Jul 22Aug 6Aug 21Sep 5Sep 20Oct 5Oct 20rankOct 18, 2026 – Oct 20, 2026 · 3 observations · Updated Oct 18, 2026pluginstats.com
vite-ssg npm ranking history: currently #694 (by weekly downloads).

Listing placement

All npm2,320 listings · 116 pages · 1,161 shown · page 35, #15 (overall #695)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins253 listings · 13 pages · page 6, #13 (overall #113)
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 (122)
Recent weekly downloads observations for vite-ssg
Date (UTC)Weekly downloadsChange vs. previous
29,825+4.5K
25,372-6.8K
32,217-1.4K
33,612-13.7K
47,262-11.3K
58,5770
58,577-1.3K
59,863+1.3K
58,531-125
58,656+3K
55,691+926
54,765-579
55,344-8.8K
64,178—

Similar npm Vite plugins plugins

All 20 vite-ssg 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-ssg. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.