Skip to content
PluginStats

@preact/preset-vite weekly downloads statistics

By preact · npm · Vite plugins

Preact preset for the vite bundler

View on npm Stale · Oct 17, 2026

@preact/preset-vite has 367,817 recorded weekly downloads on npm, a decrease of 31.8% over the past 30 days, ranking #280 of 2,256 tracked listings.

Weekly downloads
367,817
Official API · Oct 17, 2026
7-day growth
-52.6%
-407.7K weekly downloads
30-day growth
-31.8%
-171.9K weekly downloads
90-day growth
-19.0%
-86.2K weekly downloads
Rank
#280
Among tracked npm listings

About @preact/preset-vite

@preact/preset-vite

An all in one preset for writing Preact apps with the vite bundler.

Features:

• Sets up Hot Module Replacement via prefresh • Enables Preact Devtools bridge during development • Aliases React to preact/compat

If you want to look into testing Preact with Vitest Browser mode check out vitest-browser-preact

Installation

First intall the preset package from npm:

Enhance your vite config with the Preact preset plugin in your vite.config.ts or vite.config.js:

Options

Options can be passed to our preset plugin via the first argument:

Available options

| Option | Type | Default | Description |

| devtoolsInProd | boolean | false | Inject devtools bridge in production bundle instead of only in development mode | | devToolsEnabled | boolean | true | Inject devtools bridge | | prefreshEnabled | boolean | true | Inject Prefresh for HMR | | reactAliasesEnabled | boolean | true | Aliases react, react-dom to preact/compat | | babel | object | | See Babel configuration | | prerender | object | | See Prerendering configuration |

Babel configuration

The babel option lets you add plugins, presets, and other configuration to the Babel transformation performed on each JSX/TSX file.

Prerendering configuration

| Option | Type | Default | Description |

| enabled | boolean | false | Enables prerendering | | renderTarget | string | "body" | Query selector for where to insert prerender result in your HTML template | | prerenderScript | string | undefined | Absolute path to script containing exported prerender() function. If not provided, will try to find the prerender script in the scripts listed in your HTML entrypoint | | additionalPrerenderRoutes | string[] | undefined | Prerendering will crawl your site automatically, but you'd like to prerender some pages that may not be found (such as a /404 page), use this option to specify them | | previewMiddlewareEnabled | boolean | false | Vite's preview server as of v5 will not use our prerendered HTML documents automatically. This option enables a middleware that will correct this, allowing you to test the result of prerendering locally | | previewMiddlewareFallback | string | /index.html | Fallback path to be used when an HTML document cannot be found via the preview middleware, e.g., /404 or /not-found will be used when the user requests /some-path-that-does-not-exist |

To prerender your app, you'll need to do these things: 1. Enable prerendering in the plugin options 2. Specify your render target, if you want the HTML to be inserted anywhere other than the document.body. This location likely should match render(), i.e., render(, document.querySelector('#app')) -> '#app' 4. Create and export a prerender() function from a script. You could add this to your app entrypoint or create a completely separate file for it, either will work. See below for a usage example 5. Specify where your prerender() function is by either a) adding a prerender attribute to the script tag that contains it in your entry HTML () or b) use the prerenderScript plugin option to specify the location with an absolute path

The plugin simply calls the prerender function you provide so it's up to you to determine how your app should be prerendered. You'll likely want to use preact-render-to-string, or a wrapper around it such as preact-iso's prerender, but whatever you choose, the minimum you'll need to return is an object containing an html property with your HTML string which will then be inserted according to your renderTarget.

Your prerender() function can be asynchronous, so feel free to make HTTP requests to retrieve data (fetch(...)), read files from disk (fs.readFile(...)), or similar things to set up your app.

For a full example implementation, see our demo

License

MIT, see the license file.

Description from the npm listing.

  • preact
  • vite
  • vite-plugin
  • vite-preset
  • preset

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

@preact/preset-vite weekly downloads on npm, last 90 days: 367,817 weekly downloads as of Oct 17, 2026, -19.0% over 90 days.@preact/preset-viteWeekly downloads on npm · Last 90 days367,817downloads / week-19.0% over 90 days300K400K500K600K700K800K900KJul 19Aug 3Aug 18Sep 2Sep 17Oct 2Oct 17downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 17, 2026 · 88 observations · Updated Oc…pluginstats.com
@preact/preset-vite weekly downloads on npm, last 90 days: 367,817 weekly downloads as of Oct 17, 2026, -19.0% over 90 days.

7/30/90-day growth

@preact/preset-vite weekly downloads growth on npm: -52.6% over 7 days, -31.8% over 30 days, -19.0% over 90 days.@preact/preset-viteWeekly downloads growth on npm367,817downloads / week now7-day growth-407,734 weekly downloads-52.6%30-day growth-171,860 weekly downloads-31.8%90-day growth-86,221 weekly downloads-19.0%Growth vs. nearest observation to each baseline date · Updated Oct 17, 2026pluginstats.com
@preact/preset-vite weekly downloads growth on npm: -52.6% over 7 days, -31.8% over 30 days, -19.0% over 90 days.

Ranking history

@preact/preset-vite npm ranking history: currently #280 (by weekly downloads).@preact/preset-vitenpm ranking · by weekly downloads · Last 90 days#280current rank#278#279#280#281#282Jul 21Aug 5Aug 20Sep 4Sep 19Oct 4Oct 19rankOct 18, 2026 – Oct 19, 2026 · 2 observations · Updated Oct 17, 2026pluginstats.com
@preact/preset-vite npm ranking history: currently #280 (by weekly downloads).

Listing placement

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

Listing placement

Vite plugins250 listings · 13 pages · page 2, #12 (overall #32)
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 (121)
Recent weekly downloads observations for @preact/preset-vite
Date (UTC)Weekly downloadsChange vs. previous
367,817-85.6K
453,462-10.1K
463,514-156.2K
619,724-155.9K
775,6670
775,667-7.1K
782,793+7.2K
775,551-5.7K
781,280+16.6K
764,691+3.2K
761,533+10.9K
750,667-148.4K
899,100+3.1K
896,020—

Similar npm Vite plugins plugins

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