Skip to main content
Home

Built and signed on GitHub Actions

Works with
This package works with Node.js, DenoIt is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
JSR Score94%
Publisheda year ago (1.0.3)

vite 插件,用于压缩 png 格式的图片

import { glob } from "npm:glob@^10.4.2"; /** * 从目标目录中过滤出待压缩的 png 文件 * * @param dir 目标目录 * @param pattern glob pattern * * @returns 待压缩的 png 文件数组 */ export async function filter(dir: string, pattern: string | string[]) { const compressedImages = await glob(pattern, { cwd: dir, absolute: true, }); return compressedImages; }