<p dir="auto">Using babel 6.1.2, the following js:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export default {}"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<p dir="auto">is transpiled to:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;;

Object.defineProperty(exports, &quot;__esModule&quot;, {
  value: true
});
exports.default = {};"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>

<span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">defineProperty</span><span class="pl-kos">(</span><span class="pl-s1">exports</span><span class="pl-kos">,</span> <span class="pl-s">"__esModule"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
  <span class="pl-c1">value</span>: <span class="pl-c1">true</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">exports</span><span class="pl-kos">.</span><span class="pl-c1">default</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">using the following command line</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="babel --presets es2015 --plugins transform-es2015-modules-commonjs test.js"><pre class="notranslate">babel --presets es2015 --plugins transform-es2015-modules-commonjs test.js</pre></div>
<p dir="auto">However the output with the 5.x was:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;;

Object.defineProperty(exports, &quot;__esModule&quot;, {
  value: true
});
exports[&quot;default&quot;] = {};
module.exports = exports[&quot;default&quot;];"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>

<span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">defineProperty</span><span class="pl-kos">(</span><span class="pl-s1">exports</span><span class="pl-kos">,</span> <span class="pl-s">"__esModule"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
  <span class="pl-c1">value</span>: <span class="pl-c1">true</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">exports</span><span class="pl-kos">[</span><span class="pl-s">"default"</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-s1">exports</span><span class="pl-kos">[</span><span class="pl-s">"default"</span><span class="pl-kos">]</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">looks like <code class="notranslate">module.exports = exports["default"];</code> is missing although the <code class="notranslate">transform-es2015-modules-commonjs</code> is enabled.</p>
<p dir="auto">Is it a bug or I'm missing something ?<br>
Thank you !</p>
<p dir="auto">Let's say we have the following very simple code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const a = 3;
export default a;"><pre class="notranslate"><code class="notranslate">const a = 3;
export default a;
</code></pre></div>
<p dir="auto">Pre babel 6, it would compile into this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;;

Object.defineProperty(exports, &quot;__esModule&quot;, {
  value: true
});
var a = 3;
exports[&quot;default&quot;] = a;
module.exports = exports[&quot;default&quot;];"><pre class="notranslate"><code class="notranslate">"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
var a = 3;
exports["default"] = a;
module.exports = exports["default"];
</code></pre></div>
<p dir="auto">Note the last line.</p>
<p dir="auto">Now in Babel 6, the default export isn't assigned properly. This may be related to: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="114369173" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/2694" data-hovercard-type="issue" data-hovercard-url="/babel/babel/issues/2694/hovercard" href="https://github.com/babel/babel/issues/2694">#2694</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;;

Object.defineProperty(exports, &quot;__esModule&quot;, {
  value: true
});
var a = 3;
exports.default = a;"><pre class="notranslate"><code class="notranslate">"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
var a = 3;
exports.default = a;
</code></pre></div>