3

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

Slava.In
  • 597
  • 1
  • 9
  • 22

0 Answers0