In Cordova, it is possible to save platforms and plugins into the config.xml
file, this way :
cordova platform add <platform> --save
cordova plugin add <plugin> --save
This is usefull for versioning in order to not commit all this generated files.
But... how can I install them back from config.xml
?
Something like : cordova platform add --source=config.xml
?
When adding plugins or platforms, use the --save flag to add them to config. xml. Ex: cordova platform add android --save. Existing projects can use cordova plugin save and cordova platform save commands to save all previously installed plugins and platforms into your project's config.
config. xml is a global configuration file that controls many aspects of a cordova application's behavior. This platform-agnostic XML file is arranged based on the W3C's Packaged Web Apps (Widgets) specification, and extended to specify core Cordova API features, plugins, and platform-specific settings.
Upd: Official docs on this topic: http://cordova.apache.org/docs/en/latest/platform_plugin_versioning_ref/index.html
Here is some docs on this feature from Tools Release: April 21, 2015:
When adding plugins or platforms, use the --save flag to add them to config.xml.
Ex: cordova platform add android --save.
Existing projects can use cordova plugin save and cordova platform save commands to save all previously installed plugins and platforms into your project's config.xml.
Platforms and plugins will be autorestored when cordova prepare is run. This allows developers to easily manage and share their dependenceis among different development enviroments and with their coworkers.
To install all plugins from the config.xml file you run:
cordova prepare
Check what plugins are loaded with:
cordova plugin list
Apparently running a command like cordova serve
will automatically add all missing platforms/plugins !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With