title: Babel-CLI set config value correctly
body: <p>I am trying to add a build command that uses babel CLI to transpile my ES6. I am having difficult pointing it correctly to babelrc.</p>
  <p>The file structure is roughly as follows:</p>
  <pre><code>root
      src
          index.js
          ...
      .babelrc
      .package.json
  </code></pre>
  <p>In my package.json, I originally tried the following:</p>
  <pre><code>  &quot;scripts&quot;: {
      &quot;build&quot;: &quot;babel --out-dir dist src&quot;,
      ...
    },
  </code></pre>
  <p>But this gave an error because of the array destructuring notation I have used in my code. I think this is because it is not picking up my <code>.babelrc</code> file. Using</p>
  <p><code>babel --presets=@babel/preset-env --out-dir dist src</code></p>
  <p>instead fixes this problem. But I would rather I didn't have to specify plugins etc. here and rely on the <code>.babelrc</code> file instead.</p>
  <p>From reading <a href="https://github.com/babel/babel/issues/5297" rel="nofollow noreferrer">this issue</a>, I get the impression babel looks for a config file in <code>src</code> rather than <code>root</code> . Looking at <a href="https://babeljs.io/docs/en/babel-cli#custom-config-path" rel="nofollow noreferrer">the documentation</a> it seems there is an option for specifying a config file, but I can't quite get it to work correctly. My attempt:</p>
  <pre><code>babel --config-file .babelrc --out-dir dist src
  </code></pre>