有没有办法通过查看插件的存储库来确定插件的Cordova所需的最低版本?
我正在查看https://github.com/apache/cordova-plugin-file,我希望在某处可以指定最低限度要求的cordova版本。
答案 0 :(得分:0)
如果在plugin的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版本。希望它有所帮助。