
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
vite-plugin-sprites
Advanced tools
一款基于NodeJs的图片合成Vite插件,可将多张小图合并成一张大图并生成对应的css样式,可有效减少服务器接收和发送请求,提高页面加载速度。
一款基于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>
FAQs
一款基于NodeJs的图片合成Vite插件,可将多张小图合并成一张大图并生成对应的css样式,可有效减少服务器接收和发送请求,提高页面加载速度。
The npm package vite-plugin-sprites receives a total of 2 weekly downloads. As such, vite-plugin-sprites popularity was classified as not popular.
We found that vite-plugin-sprites demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.