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

@ssvg/vite-plugin

v0.0.2

Published

Vite plugin SSVG integration.

Readme

@ssvg/vite-plugin

npm version License: MIT

A Vite plugin for seamless integration of sSVG files into your development workflow. Automatically compiles .ssvg files to .svg during development and processes inline <ssvg> blocks in HTML.

Note: If you're working in a React project, you may want to use our React component instead: @ssvg/react

Installation

npm install --save-dev @ssvg/vite-plugin

Requires Vite 4 or 5. The plugin includes @ssvg/core as a dependency.

Compatibility Note: This plugin now supports Vite versions 4, 5, 6, and 7. If you use an even newer version, please report any issues.

Usage

Basic Setup

Add the plugin to your vite.config.ts:

import { defineConfig } from 'vite';
import ssvgPlugin from '@ssvg/vite-plugin';

export default defineConfig({
  plugins: [
    ssvgPlugin(),
  ],
});

Options

ssvgPlugin({
  skipUnderscoreFiles: true, // Default: true - skips files starting with '_'
});

How It Works

  • Development Mode: Watches for .ssvg files and compiles them to .svg on save. Also transforms <ssvg> tags in HTML to <svg>.
  • Build Mode: No transformation of .ssvg files (they remain as-is), but <ssvg> blocks in HTML are transformed to <svg>. Focused on dev workflow for file watching.

File Structure

Place .ssvg files anywhere in your project. The plugin will create corresponding .svg files:

project/
├── src/
│   ├── logo.ssvg    # → compiles to logo.svg
│   └── index.html   # can contain <ssvg> blocks
└── vite.config.ts

Inline Usage

Use <ssvg> tags in your HTML for inline graphics:

<ssvg>
  <!-- your ssvg content here -->
</ssvg>

Troubleshooting

Plugin Not Loading

  • Ensure Vite config is correct and plugin is added to plugins array
  • Check for import errors in console

Files Not Compiling

  • Verify you're running npm run dev (not build)
  • Check file paths and extensions
  • Ensure @ssvg/core is installed

TypeScript Issues

Add to your types file:

declare module '@ssvg/vite-plugin' {
  import type { Plugin } from 'vite';
  export default function ssvgPlugin(options?: { skipUnderscoreFiles?: boolean }): Plugin;
}

Errors from @ssvg/core

  • The plugin handles core compilation errors
  • Check Vite console for warnings
  • Ensure your .ssvg files are valid (see sSVG docs)

API

ssvgPlugin(options?)

  • options.skipUnderscoreFiles (boolean): Skip files starting with _. Default: true

Returns a Vite plugin.

License

MIT © SSVG