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

前端 未结 1 1907
星月不相逢
星月不相逢 2021-01-01 13:51

File fetch.json created inside plugins folder after cordova plugin add executed first time. This file also modified each time I add/remove

相关标签:
1条回答
  • 2021-01-01 14:11

    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

    0 讨论(0)
提交回复
热议问题