Removing cordova plugins from the project

前端 未结 14 1975
情书的邮戳
情书的邮戳 2020-12-12 15:50

Somehow in my app many of the cordova plugins are installed and because of that it requires access to almost everything - from my contacts to current location ( even though

相关标签:
14条回答
  • 2020-12-12 16:24

    Scripts based on processing the list of installed plugins may not work as there are dependencies between installed plugins (e,g, cordova-plugin-file and cordova-plugin-file-transfer).

    In the example, the script will find the file plugin first, then it will try to remove it and we'll get an error as file-transfer requires it. Therefore, we shall have

    0 讨论(0)
  • 2020-12-12 16:26

    First, you should list your plugins:

    cordova plugin list
    

    With this result, you can simply do:

    cordova plugin remove <PLUGIN_NAME>
    

    For example:

    cordova plugin remove org.apache.cordova.media
    

    Hope it helps.

    0 讨论(0)
  • 2020-12-12 16:27

    You could use: cordova plugins list | awk '{print $1}' | xargs cordova plugins rm

    and use cordova plugins list to verify if plugins are all removed.

    0 讨论(0)
  • 2020-12-12 16:27

    As far as I remember from Cordova, you should have an xml file in "res" folder containing the list of plugins used in your project. You probably need to remove those unused plugins from list. And also you should remove related files.

    0 讨论(0)
  • 2020-12-12 16:28

    This is the commandline for removing plugins in Cordova

    cordova plugin remove <pluginid>

    For example I ran cordova plugin and got a list of plugins then I used the id for the plugin to uninstall

    cordova plugin remove com.monday.contact-chooser

    You can get help in the commandline by typing

    cordova help <command>

    0 讨论(0)
  • 2020-12-12 16:32

    You can do it with bash as well (after switching to your Cordova project directory):

    for i in `cordova plugin ls | grep '^[^ ]*' -o`; do cordova plugin rm $i; done
    
    0 讨论(0)
提交回复
热议问题