Let's say i have a library and when i compile it with webpack i also add a banner such as this one: // LibraryName vX.X
where vX.X
is its version.
I want to compile it with npm preversion
script. As here:
"preversion": "gulp build --version MYVERSION"
Where MYVERSION
is a semver version that will appear in package.json
after calling npm version
.
How can i get that MYVERSION
from CLI command?
EDIT
I know i can simply get version from package.json
if i run it with postversion
, but i want build be before adding a git tag.