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

build-change-webpack-plugin

v1.0.0

Published

## 插件初衷

Readme

build-change-webpack-plugin

插件初衷

如果你存在如下背景,这个插件将能为你提高些许开发效率:

场景(背景):项目开发过程中,每次打包完成后,需要将产物上传到服务器查看效果。每次打包都是全量生成产物,所以都是再全量上传。

该插件为的是节约全量上传这个过程的时间,插件实现生成打包产物的时候,只生成有变更的代码,从而实现增量上传。

原理为:通过对打包的产物获取hash值,记录在node_module/.cache/build-change-webpack-plugin-manifest.json中,再次打包的时候,通过对比hash值,只生成hash值有变化的代码。

config

cacheTime

hash值有效时间,单位秒。默认值为:86400,等于一天。

rebuildChangeFiles

传入字符串数组,每个字符串应为一个文件绝对路径,文件不一定为产物代码,可以为某些配置。当数组中任意一项文件hash值有变化,将全量输出打包产物,禁用插件。

比如上传服务器的配置文件有变化,则不使用插件,则可以通过该数组配置传入配置文件的绝对路径。

use

是否开启插件,可以通过设置false关闭插件。

使用举例

const BuildChangeWebpackPlugin = require('build-change-webpack-plugin')
// webpack config
// ...
plugins: [
    new BuildChangeWebpackPlugin({
      cacheTime: 2 * 60 * 60, // 2 hours
      use: true,
      rebuildChangeFiles: [path.resolve(__dirname, './.env')]
    })
]
// ...