使用 patch-package 来修改 node_modules 里面的文件更方便
步骤很简单:
安装patch-package:
npm i patch-package --save-dev
修改package.json,新增命令postinstall:
"scripts": {
+ "postinstall": "patch-package"
}
修改node_modules
里面的代码
执行命令:npx patch-package xxx
。
调试:
image.png
网友评论