修改npm包源码
yarn add patch-package
script中新增
"postinstall": "patch-package"
更改node_modules中对应的代码后执行
npx patch-package 包名
装同一个包的不同版本
yarn add 别名@yarn:包名@版本号
如:yarn add @antv/x6V2@yarn:@antv/x6@2
会新增一个依赖:
"@antv/x6V2": "yarn:@antv/x6@2"