title: Compile javascript with dependencies using Babel
body: <p>How do I compile ES6 JS code with all required dependencies using <code>babel-cli</code> module? For example.</p>
  
  <p>I have the next project structure:</p>
  
  <pre><code>/lib
   /packageA
     /node_modules
     - package.json
     - index.js
   /packageB
     /node_modules
     - package.json
     - index.js
  /app
  - index.js
  - package.json
  </code></pre>
  
  <p>I import packages <code>packageA</code> and <code>packageB</code> in <code>/app/index.js</code>, all the components are written using ES6 syntax, except from the packages installed with <code>npm</code> in <code>node_modules</code>.</p>
  
  <p>I would like to compile <code>/app/index.js</code> with all the dependencies, but cannot figure out a simple way without to explicitly provide paths of <code>packageA</code> and <code>packageB</code>.</p>
  
  <p>I have found this module <a href="https://github.com/mairatma/babel-deps" rel="noreferrer">https://github.com/mairatma/babel-deps</a>, but is there other tools / approaches / native babel soultions? </p>