title: package.json vs config.xml for cordova plugins
body: <h1>What is the right way to manage Cordova's plugins &amp; platforms ?</h1>
  
  <p>On a project using <code>cordova@5.4.0</code> &amp; <code>ionic-cli@1.7.8</code>, I face 2 possibilities:</p>
  
  <h2>with Cordova (config.xml)</h2>
  
  <pre class="lang-sh prettyprint-override"><code>cordova create dummy-project &amp;&amp; cd dummy-project
  cordova platform add browser --save
  cordova plugin add cordova-plugin-device --save
  
  ## If forgot to add `--save` option, manually update config.xml
  #cordova platform save
  #cordova plugin save
  
  # reset platforms &amp; plugins, like we just checked out the repository
  rm -rf platforms plugins
  
  # `cordova prepare` automatically setup platforms &amp; plugins
  # dependencies via config.xml
  cordova prepare
  </code></pre>
  
  <p><strong>Pros</strong></p>
  
  <ul>
  <li>Platforms and plugins belong to the <em>Cordova realm</em>, so it seems intuitive to use cordova</li>
  <li><p>Platforms and plugins versions are saved in <code>config.xml</code> like below:</p>
  
  <pre><code>&lt;plugin name="cordova-plugin-device" spec="~1.0.1" /&gt;
  &lt;engine name="browser" spec="~4.0.0" /&gt;
  </code></pre></li>
  <li><p>Multiple developers who checkouts the repo will get the same dependencies</p></li>
  </ul>
  
  <p><strong>Cons</strong></p>
  
  <ul>
  <li>Yet another config file <code>config.xml</code> which clutters the project's root directory</li>
  <li>Duplicate infos in <code>plugins/fetch.json</code> and <code>platforms/platforms.json</code> ?</li>
  <li><em>Must explicitly add <code>--save</code> option</em></li>
  </ul>
  
  <h2>with Ionic (package.json)</h2>
  
  <pre class="lang-sh prettyprint-override"><code>ionic start dummy-project blank &amp;&amp; cd dummy-project
  ionic platform add browser
  ionic plugin add cordova-plugin-device
  
  # reset platforms &amp; plugins, like we just checked out the repository
  rm -rf platforms plugins
  
  # fetch platforms &amp; plugins dependencies via package.json
  ionic state restore
  </code></pre>
  
  <h2>Pros</h2>
  
  <ul>
  <li>Project's dependencies consolidated into <code>package.json</code> with the following  custom keys:
  
  <ul>
  <li><code>cordovaPlugins</code></li>
  <li><code>cordovaPlatforms</code></li>
  </ul></li>
  <li><em>Autosave</em> behaviour when adding a platform or plugin</li>
  </ul>
  
  <h2>Cons</h2>
  
  <ul>
  <li>No version pinning for plugins nor platforms in package.json <em>(that's a huge blocker for me)</em></li>
  <li>Why not put cordova plugins &amp; platforms into <code>dependencies</code> since they are NPM packages anyway ?
  <code>ionic</code> could symlink the dependancies between <code>node_modules</code> &amp; <code>{plugins,platforms}/</code></li>
  </ul>
  
  <p>Are the ionic &amp; cordova developers considering a unification/refactorisation of this matter ?</p>