npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@stattic/vite-plugin

v0.0.10

Published

Vite integration for Stattic routing conventions and static version validation.

Readme

@stattic/vite-plugin

Vite integration for Stattic routing conventions.

Use this plugin when your Vite app will be published to Stattic and you want local development, build output, and version validation to agree on routing behavior.

Install

npm install -D @stattic/vite-plugin

Usage

import { defineConfig } from "vite";
import { stattic } from "@stattic/vite-plugin";

export default defineConfig({
  plugins: [
    stattic({
      mode: "static",
      redirects: ["/old /new 301"],
      headers: "/*\n  x-frame-options: DENY",
    }),
  ],
});

What it does

  • Reads _redirects and _headers from the space root, Vite publicDir, and optional publishDir.
  • Accepts inline redirects and headers in Vite config.
  • Applies Stattic redirects, rewrites, proxy rules, Basic-Auth, and headers in the Vite dev server.
  • Writes merged _redirects and _headers into the build output.
  • Validates that the build is deployable as static files.
  • Prints a routing summary after build.

Modes

Use mode: "static" for prerendered or normal static sites. The plugin requires HTML in the build output.

Use mode: "spa" for client-rendered apps. The plugin generates fallback rewrite rules and validates that the fallback file exists:

stattic({
  mode: "spa",
  spa: {
    fallback: "/index.html",
    paths: ["/app", "/app/*"],
  },
});

If a framework emits the SPA shell under a different filename, set spa.fallbackSource. The plugin moves that file to the configured fallback before validating the build:

stattic({
  mode: "spa",
  spa: {
    fallback: "/index.html",
    fallbackSource: "/_shell.html",
  },
});

Merge order

For _redirects, config rules come first, file rules come next, and generated SPA fallback rules come last. Redirects are first-match wins, so explicit app behavior wins before the fallback.

For _headers, file rules come before config rules. Header rules are applied in order, so config can override file headers.

Generated output files start with a comment so it is clear they came from the plugin.

Publish

Build your site, then publish the generated output with the Stattic CLI:

npm run build
npx stattic-cli publish ./dist

Use npx stattic-cli publish ./dist --dry-run to validate the publish plan without uploading files.

Documentation