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

@caspeco/vite-plugin-shell

v0.2.0

Published

Vite plugin that adds the shared RMS HTML (navigation, title, favicons) to index.html

Readme

@caspeco/vite-plugin-shell

Vite plugin that adds the shared RMS HTML to the app's index.html: the navigation, title, favicons and theme color, the same in every app.

NPM Version

Setup

  1. npm install --save-dev @caspeco/vite-plugin-shell

  2. Add it to vite.config.ts:

    import caspecoShell from "@caspeco/vite-plugin-shell";
    
    export default defineConfig({
    	plugins: [caspecoShell()],
    });
  3. In index.html, wrap your app's root element in <caspeco-layout> (written exactly like that, no attributes), and add comments so the next developer knows where the rest comes from:

    <head>
    +  <!-- @caspeco/vite-plugin-shell adds charset, viewport, title, favicons, theme-color and the navigation here -->
       <link rel="manifest" href="/manifest.json" />
    </head>
    <body>
    +  <caspeco-layout>
    +     <!-- @caspeco/vite-plugin-shell adds <caspeco-top-bar> and <caspeco-navigation> here -->
          <div id="root"></div>
    +  </caspeco-layout>
       <script type="module" src="/src/main.tsx"></script>
    </body>
  4. Delete your own <meta charset>, <meta name="viewport">, <title>, favicons (<link rel="icon">, <link rel="apple-touch-icon">) and <meta name="theme-color">. The plugin adds its own.

What it adds

The dev server and vite build add this to index.html (vite build writes it to dist/index.html). First in <head>:

<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Caspeco</title>
<link rel="stylesheet" href="/shell-assets/navigation/v3/index.css" />
<script type="module" src="/shell-assets/navigation/v3/index.js" blocking="render"></script>
<link rel="icon" type="image/svg+xml" href="/shell-assets/favicon/icon.svg" />
<link rel="icon" type="image/png" sizes="16x16" href="/shell-assets/favicon/favicon-16.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/shell-assets/favicon/favicon-32.png" />
<link rel="icon" type="image/png" sizes="192x192" href="/shell-assets/favicon/icon-192.png" />
<link rel="icon" type="image/png" sizes="512x512" href="/shell-assets/favicon/icon-512.png" />
<link rel="apple-touch-icon" sizes="180x180" href="/shell-assets/favicon/apple-touch-icon.png" />
<meta name="theme-color" content="#fdfdfd" />

First in <caspeco-layout>:

<caspeco-top-bar class="casper-ui-theme"></caspeco-top-bar>
<caspeco-navigation class="casper-ui-theme"></caspeco-navigation>
  • The URLs are on the app's own domain, which serves /shell-assets/* in every environment. They don't get Vite's base. The dev server proxies /shell-assets/* to target.
  • Errors: when index.html has no <caspeco-layout> or has its own title, favicons etc., vite build fails and the dev server shows the error instead of the page.
  • Updates: a new plugin version can change the HTML, see the changelog. Check your app after updating.

Options

| Option | Default | Description | | --------------- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | | target | "https://rms.dev.caspeco.net" | Where the dev server sends /shell-assets/* requests, e.g. "https://rms.stage.caspeco.net" | | navigationUrl | "/shell-assets/navigation/v3/" on target | Where the dev server gets the navigation from, e.g. a pull request deploy "https://webcomponents.dev.caspeco.net/<pr-tag>/v3/" | | allowZoom | true | false adds maximum-scale=1, user-scalable=no to the viewport. Fails WCAG 1.4.4, only for apps that can't do without it |

target and navigationUrl only affect the dev server, the built index.html is the same for every environment.