<blockquote>
<p dir="auto">Issue originally made by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/zyy7259/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/zyy7259">@zyy7259</a></p>
</blockquote>
<h3 dir="auto">Bug information</h3>
<ul dir="auto">
<li><strong>Babel version:</strong> 6.10.4</li>
<li><strong>Node version:</strong> 5.10.1</li>
<li><strong>npm version:</strong> 3.8.3</li>
</ul>
<h3 dir="auto">Options</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="query: {
  presets: ['es2015'],
  cacheDirectory: true,
  plugins: [
    'transform-es3-property-literals',
    'transform-es3-member-expression-literals',
    [&quot;transform-es2015-modules-commonjs&quot;, {
      &quot;loose&quot;: true
    }]
  ]
}"><pre class="notranslate"><code class="notranslate">query: {
  presets: ['es2015'],
  cacheDirectory: true,
  plugins: [
    'transform-es3-property-literals',
    'transform-es3-member-expression-literals',
    ["transform-es2015-modules-commonjs", {
      "loose": true
    }]
  ]
}
</code></pre></div>
<h3 dir="auto">Input code</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export * from './mixin'"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-c1">*</span> <span class="pl-k">from</span> <span class="pl-s">'./mixin'</span></pre></div>
<h3 dir="auto">Description</h3>
<p dir="auto">The <a href="http://babeljs.io/docs/plugins/transform-es2015-modules-commonjs/" rel="nofollow">doc</a> says:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In environments that don’t support this you can enable loose mode on es6.modules and instead of using Object.defineProperty an assignment will be used instead."><pre class="notranslate"><code class="notranslate">In environments that don’t support this you can enable loose mode on es6.modules and instead of using Object.defineProperty an assignment will be used instead.
</code></pre></div>
<p dir="auto">But it only works for the <code class="notranslate">__esModule</code> property.</p>
<p dir="auto">Without loose, the output is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Object.defineProperty(exports, &quot;__esModule&quot;, {
  value: true
});"><pre class="notranslate"><code class="notranslate">Object.defineProperty(exports, "__esModule", {
  value: true
});
</code></pre></div>
<p dir="auto">With loose, the output is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="exports.__esModule = true;"><pre class="notranslate"><code class="notranslate">exports.__esModule = true;
</code></pre></div>
<p dir="auto">But when I re-export a module</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export * from './mixin'"><pre class="notranslate"><code class="notranslate">export * from './mixin'
</code></pre></div>
<p dir="auto">The output is (with or without the loose option):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Object.keys(_mixin).forEach(function (key) {
  if (key === &quot;default&quot;) return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function get() {
      return _mixin[key];
    }
  });
});"><pre class="notranslate"><code class="notranslate">Object.keys(_mixin).forEach(function (key) {
  if (key === "default") return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function get() {
      return _mixin[key];
    }
  });
});
</code></pre></div>
<p dir="auto">Which will break on IE8</p>
<blockquote>
<p dir="auto">Issue originally made by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/timdorr/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/timdorr">@timdorr</a></p>
</blockquote>
<h3 dir="auto">Bug information</h3>
<ul dir="auto">
<li><strong>Babel version:</strong> 6.7.7</li>
<li><strong>Node version:</strong> 5.5.0</li>
<li><strong>npm version:</strong> 3.8.7</li>
</ul>
<h3 dir="auto">Options</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
    &quot;presets&quot;: [&quot;es2015-loose&quot;, &quot;stage-1&quot;, &quot;react&quot;],
    &quot;plugins&quot;: [
        &quot;transform-es3-member-expression-literals&quot;,
        &quot;transform-es3-property-literals&quot;
    ]
}"><pre class="notranslate"><code class="notranslate">{
    "presets": ["es2015-loose", "stage-1", "react"],
    "plugins": [
        "transform-es3-member-expression-literals",
        "transform-es3-property-literals"
    ]
}
</code></pre></div>
<h3 dir="auto">Input code</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export { foo, bar } from './baz'"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-kos">{</span> <span class="pl-s1">foo</span><span class="pl-kos">,</span> <span class="pl-s1">bar</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'./baz'</span></pre></div>
<h3 dir="auto">Description</h3>
<p dir="auto">Apologies if this has been discussed before. T2322 is tangentially related and fixed by <code class="notranslate">add-module-exports</code>.</p>
<p dir="auto">When using the above input code, you get something like this as output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var _baz = require('./baz');

Object.defineProperty(exports, 'foo', {
  enumerable: true,
  get: function get() {
    return _baz.foo;
  }
});
Object.defineProperty(exports, 'bar', {
  enumerable: true,
  get: function get() {
    return _baz.bar;
  }
});"><pre class="notranslate"><code class="notranslate">var _baz = require('./baz');

Object.defineProperty(exports, 'foo', {
  enumerable: true,
  get: function get() {
    return _baz.foo;
  }
});
Object.defineProperty(exports, 'bar', {
  enumerable: true,
  get: function get() {
    return _baz.bar;
  }
});
</code></pre></div>
<p dir="auto">While core-js/babel-polyfill can add in defineProperty support, it cannot do getters. I'm not sure why defineProperty is used, so pardon my ignorance if I'm missing something super-obvious. But can't a simple property assignment be used instead? It's enumerable anyways, so I'm not sure of the practical difference.</p>
<p dir="auto">It appears <a href="https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-es2015-modules-commonjs/src/index.js#L17-L24">the code template remains untouched since the original 6.0.0 release</a>, so perhaps it needs to be touched up a bit? I'm happy to submit a PR.</p>