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 🙏

© 2024 – Pkg Stats / Ryan Hefner

webpack-remove-hashed-files

v1.3.1

Published

a plugin that can remove hashed files

Downloads

3

Readme

This plugin is able to remove hashed files.

If you meet any problems,publish an issue plz.

这个插件可以删除过往webpack打包hash编码后的文件。

如果你在使用过程中,遇到了什么问题,欢迎提交issue给我。

npm package NPM downloads

使用方法

  1. 初始化npm
npm init
  1. 安装模块
npm i webpack-remove-hashed-files --save-dev
  1. 修改webpack.config.js
const removeFiles = require('webpack-remove-hashed-files');
//你的打包目标文件夹 - your distnation folder
const buildDir = './dist/';
//自定义选项 - DIY options
const options = {
    exclude:["test.js","foo/bar.js","WEB-INF","test/www"]
}
//修改plugins - modify plugins
plugins:[
    new removeFiles(buildDir,options)
]

2018-3-7 修复bug

加上文件夹判断。当目标文件夹中含有子文件夹,将跳过该文件夹。

2018-3-8 功能更新

能够递归目录,判断内部子文件是否应该被删除。

2018-3-8 新增功能

新增options参数,可以配置exclude数组用来设置白名单。exclude每项最好为准确的文件或文件夹的相对路径名,暂不支持正则。

2018-7-3 修复bug && 新增功能

修改原有逻辑,现在是根据遍历传入的路径中每个文件的绝对路径是否存在于assets资源图中来判断该文件是否应该删除。同时新增删除文件夹中所有文件后会删除该空文件夹的功能。