Skip to content
PluginStats

vite-react-ssg weekly downloads statistics

By Daydreamer-riri · npm · Vite plugins

Static-site generation for React on Vite.

View on npm Stale · Oct 17, 2026

vite-react-ssg has 19,264 recorded weekly downloads on npm, a decrease of 58.6% over the past 30 days, ranking #764 of 2,256 tracked listings.

Weekly downloads
19,264
Official API · Oct 17, 2026
7-day growth
-71.6%
-48.5K weekly downloads
30-day growth
-58.6%
-27.3K weekly downloads
90-day growth
-63.4%
-33.4K weekly downloads
Rank
#764
Among tracked npm listings

About vite-react-ssg

Vite React SSG

Static-site generation for React on Vite.

See demo(also document): docs

[!IMPORTANT] React Router v7 Notice

React Router v7 now has built-in SSG support. If you are using React Router v7, we recommend using its official SSG capabilities for better official support and integration.

vite-react-ssg will continue to maintain SSG functionality for React Router v6 users.

🎈 Support for @tanstack/router and wouter is in progress!

Support for the @tanstack/router router is still experimental, and pathname.lazy.tsx routes are not yet supported. For usage examples, see: main/examples/tanstack/src/main.tsx

Table of contents

• Usage • Use CSR during development • Extra route options • entry • getStaticPaths • Data fetch • lazy • • Document head • Reactive head • Redirect • Public Base Path • Future config • CSS in JS • Critical CSS • Configuration • Custom Routes to Render • Roadmap • Credits

Usage

npm i -D vite-react-ssg react-router-dom

Use CSR during development

Vite React SSG provide SSR (Server-Side Rendering) during development to ensure consistency between development and production as much as possible.

But if you want to use CSR during development, just:

Single Page SSG

For SSG of an index page only (i.e. without react-router-dom); import vite-react-ssg/single-page instead.

Extra route options

The RouteObject of vite-react-ssg is based on react-router, and vite-react-ssg receives some additional properties.

getStaticPaths

The getStaticPaths() function should return an array of path to determine which paths will be pre-rendered by vite-react-ssg.

This function is only valid for dynamic route.

entry

You are not required to use this field. It is only necessary when "prehydration style loss" occurs. It should be the path from root to the target file.

eg: src/pages/page1.tsx

lazy

These options work well with the lazy field.

Note that during the build process, vite-react-ssg will automatically detect the files directly dynamically imported in the function you pass to the lazy field. This helps vite-react-ssg to get the route's style files or other static resources during the build, preventing flash of unstyled content.

If you still encounter FOUC (flash of unstyled content), please open an issue.

If your component isn't loading, make sure you have wrapped it or its parent in Suspense tags as described in the React documentation.

See example.

Data fetch

You can use react-router-dom's loader to fetch data at build time and use useLoaderData to get the data in the component.

In production, the loader will only be executed at build time, and the data will be fetched by the manifest generated at build time during the browser navigations .

In the development environment, the loader also runs only on the server.It provides data to the HTML during initial server rendering, and during browser route navigations , it makes calls to the server by initiating a fetch on the service.

See example | with-loader.

If you need to render some component in browser only, you can wrap your component with .

It's important that the children of is not a JSX element, but a function that returns an element. Because React will try to render children, and may use the client's API on the server.

Document head

You can use to manage all of your changes to the document head. It takes plain HTML tags and outputs plain HTML tags. It is a wrapper around React Helmet.

Nested or latter components will override duplicate usages:

Outputs:

Reactive head

Redirect

You should not use redirect in the loader. In vite-react-ssg, the loader only executes during the build process for data fetching. If you need to perform a redirect in certain situations, you can use the following method to redirect on the client side:

Public Base Path

Just set base in vite.config.ts like:

Vite React SSG will give it to the react-router's basename.

See: react-router's create-browser-router

Example

Future config

See: react-router's optsfuture

Example

Custom Router Factory

You can provide a custom router factory function via customCreateRouter option. This is useful if you want to use a different router implementation or wrap the default createBrowserRouter.

eg. sentry

CSS in JS

Use the getStyleCollector option to specify an SSR/SSG style collector. Currently only supports styled-components.

You can provide your own by looking at the implementation of any of the existing collectors.

Critical CSS

Vite React 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:

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.

React17 Support

• for react18, with flag useLegacyRender: true, it will use the legacy render and hydrate methods. • for react17, on top of above, you will need minor update to react and react-dom example to polyfill the mjs import and the react-dom/client.

Roadmap

• [x] Support react19 • [ ] no index.html mode

Credits

This project inspired by vite-ssg, thanks to @antfu for his awesome work.

License

MIT License © 2023 Riri

Description from the npm listing.

  • vite
  • vite-plugin
  • ssg
  • ssr
  • react

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-react-ssg weekly downloads on npm, last 90 days: 19,264 weekly downloads as of Oct 17, 2026, -63.4% over 90 days.vite-react-ssgWeekly downloads on npm · Last 90 days19,264downloads / week-63.4% over 90 days010K20K30K40K50K60K70KJul 19Aug 3Aug 18Sep 2Sep 17Oct 2Oct 17downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 17, 2026 · 88 observations · Updated Oc…pluginstats.com
vite-react-ssg weekly downloads on npm, last 90 days: 19,264 weekly downloads as of Oct 17, 2026, -63.4% over 90 days.

7/30/90-day growth

vite-react-ssg weekly downloads growth on npm: -71.6% over 7 days, -58.6% over 30 days, -63.4% over 90 days.vite-react-ssgWeekly downloads growth on npm19,264downloads / week now7-day growth-48,491 weekly downloads-71.6%30-day growth-27,300 weekly downloads-58.6%90-day growth-33,407 weekly downloads-63.4%Growth vs. nearest observation to each baseline date · Updated Oct 17, 2026pluginstats.com
vite-react-ssg weekly downloads growth on npm: -71.6% over 7 days, -58.6% over 30 days, -63.4% over 90 days.

Ranking history

vite-react-ssg npm ranking history: currently #764 (by weekly downloads).vite-react-ssgnpm ranking · by weekly downloads · Last 90 days#764current rank#200#300#400#500#600#700#800Jul 21Aug 5Aug 20Sep 4Sep 19Oct 4Oct 19rankOct 17, 2026 – Oct 19, 2026 · 3 observations · Updated Oct 17, 2026pluginstats.com
vite-react-ssg npm ranking history: currently #764 (by weekly downloads).

Listing placement

All npm2,256 listings · 113 pages · 1,130 shown · page 39, #4 (overall #764)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins250 listings · 13 pages · page 7, #7 (overall #127)
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 (543)
Recent weekly downloads observations for vite-react-ssg
Date (UTC)Weekly downloadsChange vs. previous
19,264-5.9K
25,186-133
25,319-11.2K
36,550-23.3K
59,8790
59,879-7.3K
67,209-546
67,755-721
68,476-387
68,863+3.6K
65,293+16.1K
49,210-6.9K
56,122+4.7K
51,395—

Similar npm Vite plugins plugins

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