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

@mcn-info/vite-ssr

v2.1.0

Published

Vite utility for server side rendering

Readme


  • Vue 3 + React 18 — auto-detects your framework from Vite plugins
  • Single entry file — one main.ts for both server and client, no boilerplate
  • Vite 8 native — lightning-fast HMR even in SSR mode
  • Lightweight — thin layer over Vite, unopinionated about routing and API logic
  • TypeScript first — full type definitions for every export

Quick Start (Vue)

pnpm create vite my-app --template vue-ts
cd my-app
pnpm add @mcn-info/vite-ssr vue-router @unhead/vue
// vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import viteSSR from '@mcn-info/vite-ssr/plugin'

export default defineConfig({
  plugins: [viteSSR(), vue()],
})
// src/main.ts
import App from './App.vue'
import routes from './routes'
import viteSSR from '@mcn-info/vite-ssr/vue'

export default viteSSR(App, { routes }, ({ app, router, initialState }) => {
  // Initialize plugins, state management, etc.
})
npx vite-ssr dev   # SSR dev server with HMR
npx vite-ssr build # Production build (client + server)

Quick Start (React)

pnpm create vite my-app --template react-ts
cd my-app
pnpm add @mcn-info/vite-ssr react-router-dom react-ssr-prepass
// vite.config.ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import viteSSR from '@mcn-info/vite-ssr/plugin'

export default defineConfig({
  plugins: [viteSSR(), react()],
})
// src/main.tsx
import App from './App'
import { routes } from './routes'
import viteSSR from '@mcn-info/vite-ssr/react'

export default viteSSR(App, { routes }, ({ initialState }) => {
  // Initialize state, etc.
})

Vite 8 note: Do not set ssr.noExternal: true in your Vite config. Vite 8's Module Runner evaluates inlined modules as ESM, which crashes on CJS packages like vue. See SSR Externalization for details.

How It Works

The plugin intercepts imports of @mcn-info/vite-ssr and redirects them to framework-specific entry points via virtual modules. It detects whether code is running on the server or client and provides the right environment automatically — so you write one entry file and the plugin handles the rest.

Documentation

| Guide | Description | |-------|-------------| | Getting Started | Full setup from zero to working SSR | | Configuration | Plugin options, handler options, CLI, build-time globals | | Data Fetching | initialState, route guards, Suspense, serverPrefetch | | Head Management | Unhead (Vue), react-helmet-async (React) | | Production | Build output, Express server, render API, deployment | | API Reference | Exhaustive type-level reference by import path | | TypeScript | Import paths, type augmentation, typed state | | Recipes | Pinia, Apollo, CSS-in-JS, i18n, error pages, middleware |

Examples

| Example | Description | |---------|-------------| | Vue | Vue 3 SSR with Unhead and API integration | | React | React 18 SSR with react-router-dom | | React + Apollo | React SSR with Apollo GraphQL | | Vanilla | Vanilla JS SSR (no framework) | | Node Server | Express production server for all examples |

Contributing

See the contributing guide for setup instructions and PR guidelines.

Credits

This project is a fork of vite-ssr by Fran Dios, later maintained by flow-tools. Migrated to ESM, Vite 8, Unhead, and pnpm.

License

MIT