vite-plugin-serve-static weekly downloads statistics
By typeparameter · npm · Vite plugins
A Vite plugin for serving static files during local development
vite-plugin-serve-static has 3,376 recorded weekly downloads on npm, a decrease of 32.1% over the past 30 days, ranking #1219 of 2,322 tracked listings.
About vite-plugin-serve-static
vite-plugin-serve-static
A simple Vite plugin for serving arbitrary static files that aren't in your public directory.
// vite.config.ts
import path from "path";
import { defineConfig } from "vite";
import serveStatic from "vite-plugin-serve-static";
const serveStaticPlugin = serveStatic({
rules: [
{
pattern: /^\/metadata\.json/,
resolve: path.join(".", "metadata.json"),
},
{
pattern: /^\/dog-photos\/.*/,
resolve: ([match]) => path.join("..", match),
},
{
pattern: /^\/author-photos\/(.*)/,
resolve: (groups) => path.join("..", "authors", groups[1]) + ".jpg",
},
],
});
export default defineConfig({
plugins: [serveStaticPlugin],
});
Config
The configuration is provided as an object with rules, plus an optional global contentType.
Each rule defines which patterns to intercept and how to resolve them. Each pattern is defined as a regular expression. The resolve property can either be a string containing the path to a single file or a function that returns a string given the result of executing the pattern against the request path. Rules can also specify headers to apply per match.
const serveStaticPlugin = serveStatic({
contentType: "text/plain",
rules: [
{
pattern: /^\/metadata\.json/,
resolve: path.join(".", "metadata.json"),
headers: {
"Cache-Control": "no-store",
"X-Static-File": "true",
},
},
],
});
License
Licensed under the MIT License.
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
7/30/90-day growth
Ranking history
Listing placement
Listing placement
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)Similar npm Vite plugins plugins
All 20 vite-plugin-serve-static alternativesData 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-serve-static. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.