What is the purpose of fetch.json file inside cordova plugins folder?

拥有回忆 提交于 2019-11-30 11:22:33

Looks like this file tracks installed plugins, their origin and revision, like npm package.json dependencies does, but for plugman. I guess and hope this should migrate to the npm standard soon.

This file is updated on cordova add/remove plugins (https://github.com/apache/cordova-lib/blob/e4e5904619bab05705d62bce92a4c4cd0d45bb82/cordova-lib/src/cordova/plugin.js#L272)

When we cordova prepare, cordova reads plugin list from plugins/ios.json (for ios), then, for each one :

  • get the plugin infos from plugins/fetch.json
  • try to find the plugin locally

looks like its not possible to restore plugins with this file. My workflow is :

  • define plugins dependencies in config.xml
  • remote platforms and empty plugins folder
  • run cordova platform add xxx

this will refetch plugins as defined in config.xml

Looks like the only doc is the source code : https://github.com/apache/cordova-lib/search?utf8=%E2%9C%93&q=fetch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!