How to represent build number in NPM version?

后端 未结 1 367
小蘑菇
小蘑菇 2021-01-12 04:19

I would like to attach a build number to my project in package.json. I\'m looking for the best way to do so.

I\'ve found that node-semver recognizes a string as a bu

相关标签:
1条回答
  • 2021-01-12 04:54

    + is indeed the way to represent build numbers. But having different builds of the same version does not make sense from an npm semver perspective. So stripping out the build number makes a certain amount of sense.

    If you are doing different builds because these are a series of prereleases, use - instead of +. npm version prerelease will increment 1.0.0 to 1.0.1-0. Another npm version prerelease will increment to 1.0.1-1.

    0 讨论(0)
提交回复
热议问题