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

vite-plugin-supersvg

v0.0.7

Published

A Vite plugin to create SVG sprites for easy use.

Downloads

11

Readme

🧪 vite-plugin-supersvg

Porque mantener tus sprites SVG actualizados manualmente es doloroso.

Este plugin para Vite se encarga de observar cambios en tu carpeta de íconos SVG y regenerar automáticamente sprites organizados por carpetas, de modo que sean fácilmente utilizables en tus proyectos, sin necesidad de Javascript. Directamente con HTML.

🧠 ¿Qué hace este plugin?

  • Observa las carpetas en src/icons/
  • Genera un archivo .svg con múltiples iconos (sprite svg) por cada carpeta.
  • Genera los sprites en public/assets/icons/ con el nombre de la carpeta.
  • Vuelve a generar cuando:
    • Se añade un SVG a src/icons/
    • Se modifica un SVG de src/icons/
    • Se elimina un SVG de src/icons/

📦 Instalación

npm install -D @manzdev/vite-plugin-supersvg

⚙️ Configuración

Agrega el plugin en tu vite.config.js o vite.config.ts:

import supersvgPlugin from 'vite-plugin-supersvg';

export default {
  plugins: [
    supersvgPlugin()
  ]
};

Si estás usando Astro, también puedes usarlo, ya que Astro usa Vite:

import { defineConfig } from "astro/config";
import supersvgPlugin from 'vite-plugin-supersvg';

export default defineConfig({
  vite: {
    plugins: [
      supersvgPlugin()
    ]
  }
});

📁 Uso

src/
└── icons/
    ├── social/
    │   ├── twitter.svg
    │   └── github.svg
    └── ui/
        ├── close.svg
        └── menu.svg

Esto generará:

public/
└── assets/
    └── icons/
        ├── social.svg (con twitter y github)
        └── ui.svg (con close y menu)

Cada archivo .svg en public/assets/icons es un sprite listo para usar con:

<svg><use href="/assets/icons/social.svg#twitter" /></svg>

💡 Consejos al usar iconos

  • Puedes utilizar icones para buscar y descargar iconos.

  • Si usas fill="currentColor" o stroke="currentColor" en tus iconos SVG, luego podrás usar la propiedad color de CSS para dar color a tus iconos SVG.

  • Puedes utilizar variables CSS en tus atributos SVG para personalizar desde fuera aspectos como colores, tamaños, etc.

🛠 API

Si lo deseas, puedes personalizar las carpetas o configuración:

import supersvgPlugin from 'vite-plugin-supersvg';

export default {
  plugins: [
    supersvgPlugin({
      srcDir: 'src/svgicons/',        // Carpeta de ficheros SVG
      destDir: 'public/icons/',       // Carpeta de sprites finales
      config: {                       // Configuración de svg-sprite
        shape: {
          spacing: { padding: 2 },
        },
      },
      lazy: true                // Sólo genera cuando ocurren cambios
    })
  ]
};

Puedes ver las opciones que puedes pasar a config en la documentación de svg-sprite.

📡 Dependencias

🧼 Cosas que no hace (todavía)

  • No borra los sprites si eliminas una carpeta entera.
  • No da abrazos.