[英]Using fork of Reactjs in a different project
I'm having trouble determining how to reference my react fork in a project I want to use it in while a PR request I made is being reviewed. 在审查我提出的PR要求时,我很难确定如何在要使用它的项目中引用我的React分支。 Since the root
package.json
is react-tools
, I can't use the npm github references. 由于根
package.json
是react-tools
,所以我不能使用npm github引用。 I also haven't had success making a local path reference to any of the react subdirectories I've tried. 我也没有成功对我尝试过的任何react子目录进行本地路径引用。
How can i use my version of react in my separate project? 如何在单独的项目中使用我的React版本?
The solution here turned out to be npm link
原来这里的解决方案是
npm link
In ./project_dir
, run npm link /path/to/react/repo/build/npm-react
在
./project_dir
,运行npm link /path/to/react/repo/build/npm-react
This creates a sym link from the react
npm module to the project node_modules/react
directory. 这将创建一个从
react
npm模块到项目node_modules/react
目录的node_modules/react
链接。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.