【问题标题】:Minimal cordova version for plugin插件的最小科尔多瓦版本
【发布时间】:2016-05-02 21:52:58
【问题描述】:

有没有办法通过查看插件的存储库来确定插件所需的最低 Cordova 版本?

我正在查看https://github.com/apache/cordova-plugin-file,我希望在某处指定最低要求的cordova版本。

【问题讨论】:

    标签: cordova cordova-plugins


    【解决方案1】:

    如果在插件的 package.json 中定义,你可以了解它。不幸的是,在文件插件的情况下,它没有定义。在这种情况下,插件安装的行为遵循cordova官方文档中的定义,

    Cordova 6.1.0 added support for specifying the Cordova-related dependencies of a plugin as part of the plugin's package.json file. Plugins may list the dependencies for multiple releases so as to provide guidance to the Cordova CLI when it is selecting the version of a plugin to fetch from npm. The CLI will choose the latest release of a plugin that is compatible with the local project's installed platforms and plugins as well as the the local Cordova CLI version. If no releases of the plugin are compatible, the CLI will warn the user about the failed requirements and fall back to the old behavior of fetching the latest release.
    
    This feature is intended to eventually replace the engines element in plugin.xml. Listing dependencies is a good way to ensure that your plugin will not appear broken or cause build errors when fetched from npm. If the latest release of the plugin is not compatible with a project, the CLI will give the app developer a list of unmet project requirements so that they are aware of incompatibilites and can update their project to support your plugin. This allows your plugin to respond to breaking changes without fear of confusing devlopers who are building against old platforms and plugins.
    

    查看此link 了解更多信息。看看file opener plugin's package.json,它定义了最低要求的cordova 版本。希望对您有所帮助。

    【讨论】:

    • @LevKisselman 你能接受这个答案,以便对其他人也有帮助吗?
    猜你喜欢
    • 2017-01-11
    • 1970-01-01
    • 1970-01-01
    • 2015-10-13
    • 1970-01-01
    • 2016-08-30
    • 1970-01-01
    • 2015-05-19
    • 1970-01-01
    相关资源
    最近更新 更多