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

static-resource-hash-webpack-plugin

v1.0.2

Published

基于WebPack HTML/CSS/JS/Image Hash功能。实现逻辑为 当所有文件生成后,通过查找文件引用来更新Hash后的文件名。不支持动态路径引用。

Readme

static-resource-hash-webpack-plugin

基于WebPack HTML/CSS/JS/Image Hash功能。实现逻辑为 当所有文件生成后,通过查找文件引用来更新Hash后的文件名。不支持动态路径引用。

GitHub地址:https://github.com/li-guang/static-resource-hash-webpack-plugin

使用说明

在WebPack中使用时,要将此模块放置在最后,因为模块的执行是在最终生成的文件中进行的。

解析时,如果是CSS文件,引用文件以点开始或者非斜杠开头,则路径以CSS文件所在目录为基目录。如果其它文件,则以destRoot目录为基目录。

依赖crypto及glob

第一步,引用模块:

var StaticResHashPlugin = require('static-resource-hash-webpack-plugin')

第二步,加入到webpack plugins中:

new StaticResHashPlugin({
  log: true,
  hashLength: 8,
  destRoot: 'dist',
  hashFiles: ['/img/**/*', '/components/**/*.html', '/fonts/**/*', '/*.js', '/404.html', '/css/*.css' ],
  hostFiles: ['/**/*.js', '/**/*.html', '/css/*.css'],
  delay: 0
})
  • log 默认值为false,不输出Log信息
  • hashLength Hash值的长度,默认为8位,一般无需指定
  • destRoot 执行此Hash操作的目录,应该为输出目录
  • hashFiles 执行Hash操作的文件,即需要对哪些文件进行Hash重命名操作
  • hostFiles 在哪些文件里面查找文件引用,并执行替换
  • delay 此操作的执行延时(毫秒),默认不使用延时,即delay=0。如果出现提示某某文件不存在时,可以使用100ms的延时解决此问题。