<p dir="auto"><a href="https://twitter.com/jaffathecake/status/553159821135200256" rel="nofollow">https://twitter.com/jaffathecake/status/553159821135200256</a> this work in Traceur,<br>
but dont work in 6to5 <a href="https://6to5.org/repl/#?experimental=true&amp;playground=true&amp;evaluate=true&amp;code=function%20func(%7Bfoo%20%3D%20'test'%2C%20bar%20%3D%20'test2'%7D%3D%7B%7D)%20%7B%0A%20%20return%20%5Bfoo%2C%20bar%5D%0A%7D" rel="nofollow">https://6to5.org/repl/#?experimental=true&amp;playground=true&amp;evaluate=true&amp;code=function%20func(%7Bfoo%20%3D%20'test'%2C%20bar%20%3D%20'test2'%7D%3D%7B%7D)%20%7B%0A%20%20return%20%5Bfoo%2C%20bar%5D%0A%7D</a></p>
<p dir="auto">First, I'm not positive this issue is specifically related to <code class="notranslate">@babel/preset-env</code>; the problem could also lie in <code class="notranslate">between-chair-and-keyboard</code>, <code class="notranslate">webpack</code>, <code class="notranslate">@babel/plugin-transform-runtime</code>, or <code class="notranslate">browserlist</code>. But, I thought I'd try here.</p>
<p dir="auto">I configured <code class="notranslate">@babel/preset-env</code> in the webpack config as follows:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="...
plugins: ['@babel/plugin-transform-runtime'],
presets: [
  ['@babel/preset-env', {
    modules: false,
    targets: {
      node: 'current',
      browsers: ['defaults', 'not ie &lt;= 10'],
    },
  }],
..."><pre class="notranslate">...
<span class="pl-s1">plugins</span>: <span class="pl-kos">[</span><span class="pl-s">'@babel/plugin-transform-runtime'</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-s1">presets</span>: <span class="pl-kos">[</span>
  <span class="pl-kos">[</span><span class="pl-s">'@babel/preset-env'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
    <span class="pl-c1">modules</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
    <span class="pl-c1">targets</span>: <span class="pl-kos">{</span>
      <span class="pl-c1">node</span>: <span class="pl-s">'current'</span><span class="pl-kos">,</span>
      <span class="pl-c1">browsers</span>: <span class="pl-kos">[</span><span class="pl-s">'defaults'</span><span class="pl-kos">,</span> <span class="pl-s">'not ie &lt;= 10'</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
...</pre></div>
<p dir="auto">With that configuration, I noticed that the transpiled file retains <code class="notranslate">destructuring parameters</code> from my original, ES6+-filled code. According to <a href="http://kangax.github.io/compat-table/es6/#test-destructuring,_parameters" rel="nofollow">the compat tables</a>, this is not supported in several environments IE 11+.</p>
<p dir="auto">However, when I remove <code class="notranslate">node: 'current'</code> from <code class="notranslate">targets</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="...
targets: {
  browsers: ['defaults', 'not ie &lt;= 10'],
},
..."><pre class="notranslate">...
<span class="pl-s1">targets</span>: <span class="pl-kos">{</span>
  <span class="pl-c1">browsers</span>: <span class="pl-kos">[</span><span class="pl-s">'defaults'</span><span class="pl-kos">,</span> <span class="pl-s">'not ie &lt;= 10'</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
...</pre></div>
<p dir="auto">the transpiled file then shows webpack pulling in an <code class="notranslate">__webpack_require__</code> for <code class="notranslate">_slicedToArray</code> to support <code class="notranslate">destructuring parameters</code> (with arrays):</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var _slicedToArray = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ &quot;./node_modules/@babel/runtime/helpers/slicedToArray.js&quot;);"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">_slicedToArray</span> <span class="pl-c1">=</span> <span class="pl-en">__webpack_require__</span><span class="pl-kos">(</span><span class="pl-c">/*! @babel/runtime/helpers/slicedToArray */</span> <span class="pl-s">"./node_modules/@babel/runtime/helpers/slicedToArray.js"</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Now, I'm running Node v9.7.1, which natively supports <code class="notranslate">destructuring parameters</code> (with arrays); but I would think that if <code class="notranslate">@babel/preset-env</code> is considering the lowest common denominator, that the <code class="notranslate">_slicedToArray</code> <code class="notranslate">__webpack_require__</code> would actually be pulled in for <em><strong>both</strong></em> configurations since the lowest common denominator should be the browsers target either way.</p>
<p dir="auto">However, because <code class="notranslate">_slicedToArray</code> only shows up when the node target is omitted, (to me) it seems like the lowest common denominator is not being found correctly, as described in <a href="https://github.com/babel/babel/tree/master/packages/babel-preset-env#determine-the-lowest-common-denominator-of-plugins-to-be-included-in-the-preset">the @babel/preset-env README</a>.</p>
<p dir="auto">Am I missing something? Or, is this a bug?</p>
<p dir="auto">- Sincerely Confused</p>
<p dir="auto">Details:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="node: v9.7.1
@babel/core: 7.0.0-beta.40
@babel/plugin-transform-runtime: 7.0.0-beta.40
@babel/preset-env: 7.0.0-beta.40
@babel/runtime: 7.0.0-beta.40
babel-loader: 8.0.0-beta.2
webpack: 4.1.1
webpack-cli: 2.0.11"><pre class="notranslate"><code class="notranslate">node: v9.7.1
@babel/core: 7.0.0-beta.40
@babel/plugin-transform-runtime: 7.0.0-beta.40
@babel/preset-env: 7.0.0-beta.40
@babel/runtime: 7.0.0-beta.40
babel-loader: 8.0.0-beta.2
webpack: 4.1.1
webpack-cli: 2.0.11
</code></pre></div>