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

cxj-webpack-image-optimizer-loader

v1.0.0

Published

一个高性能的图片优化 webpack loader,支持自动压缩和转换图片格式

Readme

webpack-image-optimizer-loader

一个高性能的图片优化 webpack loader,支持自动压缩和转换图片格式。

✨ 特性

  • 🚀 基于 sharp 库,性能优异
  • 🖼️ 支持转换为 WebP、JPEG、PNG 格式
  • 📏 支持调整图片尺寸
  • 🔧 可配置压缩质量
  • 📦 支持 webpack 4 和 5

📦 安装

bash npm install --save-dev @你的npm用户名/webpack-image-optimizer-loader 或者 yarn add -D @你的npm用户名/webpack-image-optimizer-loader

🔨 使用方法

在你的 webpack 配置文件中: javascript

🌰 示例

module.exports = {
    module: {
        rules: [
            {
                test: /\.(png|jpe?g)$/i,
                use: [
                    {
                        loader: 'webpack-image-optimizer-loader',
                        options: {
                            quality: 75,
                            format: 'webp',
                            width: 800 // 可选
                        }
                    }
                ]
            }
        ]
    }
};

📝 配置选项

| 选项 | 类型 | 默认值 | 描述 | | ------- | ------ | --------- | -------------------------------- | | quality | number | 80 | 压缩质量 (1-100) | | format | string | 'webp' | 输出格式 ('webp', 'jpeg', 'png') | | width | number | undefined | 最大宽度(可选) | | height | number | undefined | 最大高度(可选) |

🤝 贡献指南

  1. Fork 本仓库
  2. 创建你的特性分支 (git checkout -b feature/AmazingFeature)
  3. 提交你的改动 (git commit -m 'Add some AmazingFeature')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 开启一个 Pull Request

📄 许可证

本项目使用 MIT 许可证 - 查看 LICENSE 文件了解详情

🙏 致谢

  • sharp - 高性能 Node.js 图片处理库
  • webpack - 优秀的模块打包工具

📞 联系方式

如果你有任何问题或建议,欢迎:

  • 提交 Issue
  • 发送邮件到:[你的邮箱]

🔄 更新日志

1.0.0 (2024-XX-XX)

  • 🎉 首次发布
  • ✨ 支持图片格式转换
  • 📏 支持图片尺寸调整
  • 🔧 支持质量配置