<plugin>

plugin

Specifies details about what plugin to restore during a prepare. This element is automatically added to a project's config.xml when a plugin is added using the --save flag. See the CLI reference for more information on adding plugins.

Attributes(type)
Only for platform:
Description
name(string) Required
Name of the plugin to be restored
spec(string) Required
Details about the plugin to be restored. This could be a major.minor.patch version number, a directory containing the plugin or a url pointing to a git repository. This information will be used to retrieve the plugin code to restore from NPM, a local directory or a git repository. See Plugin Spec for further details.

Examples:

<plugin name="cordova-plugin-device" spec="^1.1.0" />
<plugin name="cordova-plugin-device" spec="https://github.com/apache/cordova-plugin-device.git#1.0.0" />

variable

Persists the value of a CLI variable to be used when restoring a plugin during a prepare. This element is added to config.xml when a plugin that uses CLI variables is added using the --save flag. See the CLI reference for more information on adding plugins.

Note that this value is only used when the plugin is restored to the project during a prepare, changing it will not change the value used by the plugin in the current project. In order for changes to this value to take effect, remove the plugin from the project and restore it by running cordova prepare. See the preference element of plugin.xml for more details on CLI variables.

Attributes(type)
Only for platform:
Description
name(string) Required
Name of the CLI variable. Can only contain capital letters, digits, and underscores.
value(string) Required
Value of the CLI variable to be used when restoring the parent plugin during a prepare.

Examples:

<plugin name="cordova-plugin-device" spec="^1.1.0">
    <variable name="MY_VARIABLE" value="my_variable_value" />
</plugin>
doc_cordova
2017-01-31 03:39:51
Comments
Leave a Comment

Please login to continue.