【发布时间】:2019-12-04 13:17:37
【问题描述】:
Yarn 想在发布节点模块时添加一个 git 标签。但是,此文件夹已添加到 gitignore。
yarn publish dist
Output:
The following paths are ignored by one of your .gitignore files:
dist/package.json
Use -f if you really want to add them.
info Visit https://yarnpkg.com/en/docs/cli/publish for documentation about this command.
如何将 dist 保留在 gitignore 中,但要让 yarn 能够将 dist 文件夹添加到 git 提交中?
我试过了:
-.npmignore 没有 dist 文件夹(-->被纱线忽略)
-将文件数组添加到 package.json
-还有其他建议吗?
【问题讨论】:
-
我不清楚
yarn publish和 Git 提交之间的关系。如前所述,将dist/添加到 Git 提交实际上是您的目标吗? -
每当你运行发布命令时,Yarn publish 也会推送 git 标签
-
有趣;感谢@Vincent 的澄清!
-
不是真的,因为这个问题是关于要发布哪些来源并且没有澄清纱线自动进行 git 标记