Search code examples
javascriptcordovacordova-plugins

Edit an existing cordova plugin


I want to change just a single line in an installed cordova plugin.

However, as the plugin is installed via package.json, any edit I do on the source file does not get saved as the plugin is freshly installed every time I make a new build of my app.

Is there some way to:

  1. Copy-paste the whole plugin somewhere outside the plugins folder so I can edit without it getting overwritten.
  2. Remove the plugin name from package.json and
  3. Be able to reference the plugin inside my app so I can use the methods provided by the plugin.

Thank You.


Solution

  • You can clone the plugin and make the changes you want locally. Then you can add the plugin using corodova plugin add /path/to/plugin/folder.