git - yarn publish 失败,因为 dist 文件夹被添加到 gitignore
问题描述
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.
如何在 gitignore 中保留 dist,但要让 yarn 能够将 dist 文件夹添加到 git 提交中?
我试过了:
-.npmignore 没有 dist 文件夹(-->被纱线忽略)
- 将文件数组添加到 package.json
- 有人有其他建议吗?
解决方案
我对此的解决方案(我想更多的解决方法)是yarn publish
使用--no-git-tag-version
选项调用,例如
yarn publish dist/ --no-git-tag-version
推荐阅读
- sql - 无法从 BLOB 存储打开备份设备 - 访问被拒绝
- html - 我解析了html。创建 CheckFilter 函数,如果函数返回 true,如何转换到 View1,如果返回 false,则转换到 view2。帮助
- html - 如何在 Swift 中解码 \x20\x20background?
- haskell - 如何将 Lambda 函数从命令行发送到 Haskell 程序?
- javascript - 如何在 js 上将来自 sweetalert2 的数据发送到 mysql?
- maven - 可运行 JAR 文件未针对 Cucumber BDD 框架运行
- reporting-services - 突出显示交替颜色行 SSRS 2016
- python - Django:如何填充表格中的几个空单元格
- regex - 匹配直到字符,但不包括该字符
- react-native - 如何使用 react-native-firebase 库作为侦听器从来自 Salesforce MarketingCloud 的推送通知中获取数据?