Sets config.xml version and build number from package.json
$ npm install --save-dev cordova-version
// my-version-hook.js
var version = require('cordova-version');
module.exports = function() {
return version.update();
};
<!-- config.xml -->
<hook src="my-version-hook.js" type="before_prepare" />
$ npm install --global cordova-version
$ cordova-version --help
- Semantic Versioning version and build number
- Cordova's config.xml file must exist in the root folder
MIT © Carlos Antonio