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-sprites

v0.3.0

Published

一款基于NodeJs的图片合成Vite插件,可将多张小图合并成一张大图并生成对应的css样式,可有效减少服务器接收和发送请求,提高页面加载速度。

Readme

vite-plugin-sprites

一款基于NodeJs的图片合成Vite插件,可将多张小图合并成一张大图并生成对应的css样式,可有效减少服务器接收和发送请求,提高页面加载速度。支持 Vue、React等所有框架

安装使用

安装依赖

npm install vite-plugin-sprites -D
# or
pnpm install vite-plugin-sprites -D
# or
yarn install vite-plugin-sprites -D

使用配置

// vite.config.ts
import { defineConfig } from 'vite' 
import sprites from 'vite-plugin-sprites'

export default defineConfig({
  plugins: [
    sprites({
      // 所有参数为可选
      iconPath: '/src/assets/icon', // icon图片位置,默认/src/assets/icon
      savePath: '/src/assets/icon', // 生成的图片样式存放目录,默认/src/assets/icon(插件不会创建目录,需确保存放路径存在)
      width: 500, // 合并生成的图片宽度,单位px,默认 500
      spacing: 5, //两张图片间的间距,默认 5
      prefix: 'icon-' // 生成css类名前缀,默认 icon-
    })
  ]
})

引入样式

在页面适当位置引入生成的样式,如

import './assets/icon/sprites.css'

在页面中使用

<div>
  <i class="icon-down"></i>
</div>