有没有办法忽略 npm 发布上的特定变更日志 md 文件?
我有一个 npm 包,在 ci/cd 管道期间,在发布之前会生成两个变更日志文件: CHANGELOG.md
和 CHANGELOG_INTERNAL.md
第一个通常进入 npm 包,第二个用于内部使用,并显示一些额外的重构和 ci 更改。 Npm 文档说
以下路径和文件永远不会被忽略,因此将它们添加到 .npmignore 毫无意义:
package.json、README(及其变体)、CHANGELOG(及其变体)、LICENSE / LICENCE
参考:https://npm.github.io/publishing-pkgs-docs/publishing/the-npmignore-file.html
问题:我可以以某种方式使我的 CHANGELOG_INTERNAL.md
不要在发布时转到包(最好使用 package.json
)?更改日志文件名是否有任何逻辑会阻止其发布? (因为CHANGELOG(及其变体)定义似乎有点模糊)
更新:使用npm pack
命令进行一些测试后,我发现将< .npmignore
内的 code>CHANGELOG_INTERNAL.md 有助于解决该问题。考虑到这个规则有点奇怪,CHANGELOG(及其变体)永远不会被忽略。
参考: https://docs.npmjs.com/cli/v8/using-npm/developers#keeping-files-out-of-your-package
I have an npm package where during ci/cd pipeline two changelog files are generated before the publish:CHANGELOG.md
and CHANGELOG_INTERNAL.md
First one goes to npm package normally, the second is meant for internal usage and shows some extra refactor and ci changes.
Npm docs say that
The following paths and files are never ignored, so adding them to
.npmignore is pointless:package.json, README (and its variants), CHANGELOG (and its variants),LICENSE / LICENCE
Reference: https://npm.github.io/publishing-pkgs-docs/publishing/the-npmignore-file.html
Question: Can I somehow make my CHANGELOG_INTERNAL.md
not to go to package on publish (preferably using package.json
)? And is there any logic for changelog file name that will prevent it from publishing? (cause CHANGELOG (and its variants) definition seems a bit vague)
Update: After some testing using npm pack
command, I found that putting CHANGELOG_INTERNAL.md
inside .npmignore
helps to resolve the issue. Which is a bit weird taking into account the rule, where CHANGELOG (and its variants) are never ignored.
Reference: https://docs.npmjs.com/cli/v8/using-npm/developers#keeping-files-out-of-your-package
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论