简体   繁体   中英

NX Nrwl build package Version number of Apps/Libs is allways 0.0.1

How to set the version of an NX App/Library build. If i ran nx build or nx affected or nx build:MYAPP or Lib (if publishable) the version end allways as 0.0.1 and is not in sync with the version if the main package.json which is even not clever if publishing apps + libs and some are not affected.

I tried nx Semver Plugin, which tags the build with a correct tag but the build (prod or not) ends as 0.0.1. ??

I found the azure/gitlab CI example there is nothing related to a package/version But for CI we need allways a new package version!

As the docu lacks...docu... HOW?

isn't possible.

Possible solutions are

  1. create a package.json per App/Lib Maybe not the best idea as it turns the idea of NX Monorepo upside down

  2. Write a postTarget "Hook" to update the package.json after a successful version creation via a npm node script using git describe --tags to get latest version. and npm version ${version} to update package.json.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM