
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@redbuck/shrink
Advanced tools
该工具为三部定制. 三部前端页面使用webpack打包.生成文件时,会将content-hash加入文件名. 因此生成的文件会越来越多. 同时watch模式时,也会产生大量文件
该工具利用husky@1.3.1提供的git钩子功能.
提交时,扫描cshtml文件,获取对应的js/css文件标记以及本次构建的hash.
然后再检查提交的文件中对应的js/css文件,删除其中hash不符的文件.
http://nexus.ops.svc.cluster.test/repository/npm-all/yarn add shrink -dnode ./node_modules/shrink传参方式可以通过命令行或者配置shrinkrc.js
node ./node_modules/shrink --staged false --log falseshrinkrc.js
一个commonjs模块.两者冲突时,shrinkrc.js优先级高
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| since | string | undefined | git revision |
| staged | boolean | true | 是否只检查暂存区 |
| restage | boolean | true | 删除冗余文件后是否重新暂存 |
| remove | boolean | false | 是否删除冗余文件 |
| log | boolean | true | 是否打印冗余文件 |
| branch | string | undefined | 需要检查的分支 |
| matcher | function | ()=>true | 用于筛选目标文件 |
| supports | string[] | ['.js', '.css', '.cshtml'] | 筛选目标文件的扩展名 |
FAQs
remove redundant file create by webpack watch mode
We found that @redbuck/shrink demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.