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 17, 2026

vite-ssg has 25,372 recorded weekly downloads on npm, a decrease of 45.2% over the past 30 days.

It ranks #696 of 2,251 tracked npm listings by weekly downloads.

Over 90 days, weekly downloads changed by -43.6%.

PluginStats has 121 daily observations since Jun 19, 2026; the latest is from Oct 17, 2026.

Weekly downloads
25,372
Official API · Oct 17, 2026
7-day growth
-56.7%
-33.2K weekly downloads
30-day growth
-45.2%
-20.9K weekly downloads
90-day growth
-43.6%
-19.6K weekly downloads
Rank
#696
Among tracked npm listings

About vite-ssg

Vite SSG

Static-site generation for Vue 3 on Vite.

ℹ️ 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

npm i -D vite-ssg vue-router @unhead/vue

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.

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).

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

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:

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:

Critical CSS generation will automatically be enabled for you.

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

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:

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

When using Pinia

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

When using Vuex

For an example on how to use a store with an initial state in a single page app, see the single page example.

State Serialization

By default, the state is deserialized and serialized by using JSON.stringify and JSON.parse respectively. If this approach works for you, you should definitely stick to it as it yields far better performance.

You may use the transformState option in the ViteSSGClientOptions options object as shown below. A valid approach besides JSON.stringify and JSON.parse is @nuxt/devalue (which is used by Nuxt.js):

A minor remark when using @nuxt/devalue: In case, you are getting an error because of a require within the package @nuxt/devalue, you have to add the following piece of config to your Vite config:

Async Components

Some applications may make use of Vue features that cause components to render asynchronously (e.g. suspense). When these features are used in ways that can influence initialState, the onSSRAppRendered may be used in order to ensure that all async operations are complete during the initial application render. For example:

Configuration

You can pass options to Vite SSG in the ssgOptions field of your vite.config.js

See src/types.ts. for more options available.

Custom Routes to Render

You can use the includedRoutes hook to include or exclude route paths to render, or even provide some completely custom ones.

Alternatively, you may export the includedRoutes hook from your server entry file. This will be necessary if fetching your routes requires the use of environment variables managed by Vite.

Comparison

Use Vitepress when you want:

• Zero config, out of the box SSG • A single-purpose documentation site • Lightweight (No double payload)

Use Vite SSG when you want:

• More control on the build process and tooling • The flexible plugin system • Multi-purpose application with some SSG to improve SEO and loading speed

Cons:

• Double payload

Example

See Vitesse.

Thanks to the prior work

• vitepress • vue3-vite-ssr-example • vite-ssr

Contribution

Please refer to https://github.com/antfu/contribute.

License

MIT License © 2020-PRESENT Anthony Fu

Description from the npm listing.

  • vite
  • vite-plugin
  • ssg
  • ssr

Where vite-ssg 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.

All npm2,248 listings · 113 pages · page 35, #16 (overall #696)
All npm: every listing in weekly downloads order
PNG SVG
Vite plugins250 listings · 13 pages · page 6, #14 (overall #114)
Vite plugins: every listing in weekly downloads order
PNG SVG

Charts

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

Adoption over time

vite-ssg weekly downloads on npm, last 90 days: 25,372 weekly downloads as of Oct 17, 2026, -43.6% over 90 days.vite-ssgWeekly downloads on npm · Last 90 days25,372downloads / week-43.6% over 90 days20K30K40K50K60K70KJul 19Aug 3Aug 18Sep 2Sep 17Oct 2Oct 17downloads / weekobservedarchived (Internet Archive)no observationsJul 20, 2026 – Oct 17, 2026 · 90 observations · Updated Oc…pluginstats.com
vite-ssg weekly downloads on npm, last 90 days: 25,372 weekly downloads as of Oct 17, 2026, -43.6% over 90 days.
PNG SVG

7/30/90-day growth

vite-ssg weekly downloads growth on npm: -56.7% over 7 days, -45.2% over 30 days, -43.6% over 90 days.vite-ssgWeekly downloads growth on npm25,372downloads / week now7-day growth-33,159 weekly downloads-56.7%30-day growth-20,895 weekly downloads-45.2%90-day growth-19,582 weekly downloads-43.6%Growth vs. nearest observation to each baseline date · Updated Oct 17, 2026pluginstats.com
vite-ssg weekly downloads growth on npm: -56.7% over 7 days, -45.2% over 30 days, -43.6% over 90 days.
PNG SVG

Ranking history

vite-ssg npm ranking history: currently #696 (by weekly downloads).vite-ssgnpm ranking · by weekly downloads · Last 90 days#696current rank#694#695#696#697#698Jul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18rankOct 18, 2026 – Oct 18, 2026 · 1 observations · Updated Oct 17, 2026pluginstats.com
vite-ssg npm ranking history: currently #696 (by weekly downloads).
PNG SVG

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)
Recent weekly downloads observations for vite-ssg
Date (UTC)Weekly downloadsChange vs. previous
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+184
63,994—

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