你将如何在项目中使用你自己的Next.js分支?
我尝试使用patch-package,但下一个包被Vercel覆盖了,也尝试发布到npm,但这相当困难,因为它需要首先发布到许多@next/包
你会怎么做呢?
发布于 2021-11-24 18:47:46
有些人不喜欢这种技术,但我已经在许多项目中使用过它,并取得了巨大的成功。
tl;dr -在git上派生存储库,并直接从git安装。通过使用GitPkg来处理monorepos。
上创建所需的存储库
克隆你的新分支:git clone https://github.com/<your-user-name>/<package-name>,
npm install /#
- Important: replace the `<commit-ish>` with the hash from Step #3 (note: a tag or branch name works too). This step is important as it makes sure you are locked to a specific version.
- If you are referencing a monorepo, you can specify the subdir for the particular package you want by using [GitPkg](https://gitpkg.vercel.app/).保持最新状态
要更新包,您需要合并原始作者所做的任何新的“上游”更改,并将这些更改推送到您的分支存储库。然后重复上面的步骤#4。
git添加上游https://github.com/vercel/next.js.git
git fetch上游git签出git merge上游/
fork解决所有合并冲突,然后推送到:git push origin
https://stackoverflow.com/questions/70101262
复制相似问题