<p dir="auto">Hello</p>
<p dir="auto">I am a problem with Babel 6.0.17 and importing modules. My files:</p>
<p dir="auto">js/actions/constantsActions</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export function updateConstants {...}"><pre class="notranslate"><code class="notranslate">export function updateConstants {...}
</code></pre></div>
<p dir="auto">js/actions/index.js</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import * as constantsActions from './constantsActions';

export default {
  ...constantsActions
};"><pre class="notranslate"><code class="notranslate">import * as constantsActions from './constantsActions';

export default {
  ...constantsActions
};
</code></pre></div>
<p dir="auto">js/main.js</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import {constantsUpdate} from './actions';

constantsUpdate() // function constantsUpdate is undefined"><pre class="notranslate"><code class="notranslate">import {constantsUpdate} from './actions';

constantsUpdate() // function constantsUpdate is undefined
</code></pre></div>
<p dir="auto">The problem is in main.js with the expected function constantsUpdate being undefined. This code was working with Babel 5. Is there a plugin I am missing or could this be a bug?</p>
<p dir="auto">.babelrc</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;presets&quot;: [
    &quot;es2015&quot;,
    &quot;stage-0&quot;,
    &quot;react&quot;
  ],
  &quot;plugins&quot;: [
    &quot;transform-object-rest-spread&quot;
  ]
}"><pre class="notranslate"><code class="notranslate">{
  "presets": [
    "es2015",
    "stage-0",
    "react"
  ],
  "plugins": [
    "transform-object-rest-spread"
  ]
}
</code></pre></div>
<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>