babel-plugin-inline-package-json | Babel plugin for inlining references to package.json values
kandi X-RAY | babel-plugin-inline-package-json Summary
kandi X-RAY | babel-plugin-inline-package-json Summary
Babel plugin for inlining references to package.json values
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of babel-plugin-inline-package-json
babel-plugin-inline-package-json Key Features
babel-plugin-inline-package-json Examples and Code Snippets
Community Discussions
Trending Discussions on babel-plugin-inline-package-json
QUESTION
I am using a package called babel-plugin-inline-package-json
to pull out my version number during my build step. Currently using semantic-release the package version is always 0.0.0 instead of the correct version number. I setup semantic-release to trigger a build using the npm preversion
command. I was under the impression that by the time semantic-release triggered preversion it would already have the new version inserted into the package.json, but I keep getting 0.0.0 instead. What would be the correct way to pull out the version number so I can get it during my build step?
ANSWER
Answered 2018-Nov-24 at 19:39semantic-release doesn't trigger the npm preversion
directly, it runs npm version
then npm publish
. The npm hook scripts (preversion
, postversion
, prepack
, postpack
, prepublish
, prepublishOnly
, postpublish
, prepare
) are triggered by npm
itself.
As suggested by it's name the hook preversion
run just before the version is updated. You need to use the postversion
hook which run after the version is updated.
For more details see: How can I use a npm build script that requires the package.json’s version ?
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install babel-plugin-inline-package-json
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page