Skip to content

xqin/block-core-js-postinstall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

block-core-js-postinstall

使用方法

打补丁

curl -s https://raw.githubusercontent.com/xqin/block-core-js-postinstall/master/npm.sh | bash -

恢复原样

curl -s https://raw.githubusercontent.com/xqin/block-core-js-postinstall/master/npm.sh | RESTORE=1 bash -

原理

通过给 npmpostinstall.js 文件添加自定义代码, 来实现屏蔽 npm 执行 core-js 这个模块的 postinstall 这个过程, 以达到屏蔽广告的效果.

将下面的代码添加到 log.silly 这行前面:

if(/^core-js(?:-(builder|bundle|compat|pure))?@/.test(packageId(pkg))){next();return;}

修改后的代码大致如下:

patched

预览

打补丁前

before

打补丁后

after

About

Block core-js spam in postinstall

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages