如何在使用create-react-app时设置模板注册表?



据我所知,当运行npx create-react-app my-app --template template时,我可以从我设置的全局注册表中获得模板。但是,我需要从私有注册表和其他包(运行npx create-react-app my-app时安装的包)从https://registry.yarnpkg.com/的CRA模板。

我知道我可以删除yarn.lock,更改注册表并重新安装,但我写的模板是我们团队使用的,所以我不能要求每个人都这样做。这真的不是一个好的解决方案。

运行npx create-react-app my-app --template template时可以只设置模板注册表吗?

我解决了。

runyarn config set "@company:registry" "http://private-registry.company.com"

问题解决了!

最新更新