<p dir="auto">Choose one: is this a bug report or feature request?<br>
Bug report</p>

<h3 dir="auto">Input Code</h3>
<p dir="auto">module-sub.js</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export default function test(arg) {
  return typeof arg
}

export const a = 1
export const b = 2"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-k">function</span> <span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s1">arg</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">return</span> <span class="pl-k">typeof</span> <span class="pl-s1">arg</span>
<span class="pl-kos">}</span>

<span class="pl-k">export</span> <span class="pl-k">const</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span>
<span class="pl-k">export</span> <span class="pl-k">const</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-c1">2</span></pre></div>
<p dir="auto">module.js</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export * from './module-sub'"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-c1">*</span> <span class="pl-k">from</span> <span class="pl-s">'./module-sub'</span></pre></div>
<p dir="auto">common.js</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var x = typeof arg
module.exports = x"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-k">typeof</span> <span class="pl-s1">arg</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">x</span></pre></div>
<h3 dir="auto">Babel/Babylon Configuration (.babelrc, package.json, cli command)</h3>

<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;presets&quot;: [[&quot;es2015&quot;, { &quot;modules&quot;: false }], &quot;stage-2&quot;],
  &quot;plugins&quot;: [&quot;transform-runtime&quot;],
  &quot;env&quot;: {
    &quot;test&quot;: {
      &quot;presets&quot;: [&quot;env&quot;, &quot;stage-2&quot;],
      &quot;plugins&quot;: [&quot;istanbul&quot;]
    }
  }
}"><pre class="notranslate">{
  <span class="pl-ent">"presets"</span>: [[<span class="pl-s"><span class="pl-pds">"</span>es2015<span class="pl-pds">"</span></span>, { <span class="pl-ent">"modules"</span>: <span class="pl-c1">false</span> }], <span class="pl-s"><span class="pl-pds">"</span>stage-2<span class="pl-pds">"</span></span>],
  <span class="pl-ent">"plugins"</span>: [<span class="pl-s"><span class="pl-pds">"</span>transform-runtime<span class="pl-pds">"</span></span>],
  <span class="pl-ent">"env"</span>: {
    <span class="pl-ent">"test"</span>: {
      <span class="pl-ent">"presets"</span>: [<span class="pl-s"><span class="pl-pds">"</span>env<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>stage-2<span class="pl-pds">"</span></span>],
      <span class="pl-ent">"plugins"</span>: [<span class="pl-s"><span class="pl-pds">"</span>istanbul<span class="pl-pds">"</span></span>]
    }
  }
}</pre></div>
<p dir="auto">and</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;presets&quot;: [&quot;es2015&quot;, &quot;stage-2&quot;],
  &quot;plugins&quot;: [&quot;transform-runtime&quot;],
  &quot;env&quot;: {
    &quot;test&quot;: {
      &quot;presets&quot;: [&quot;env&quot;, &quot;stage-2&quot;],
      &quot;plugins&quot;: [&quot;istanbul&quot;]
    }
  }
}
"><pre class="notranslate">{
  <span class="pl-ent">"presets"</span>: [<span class="pl-s"><span class="pl-pds">"</span>es2015<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>stage-2<span class="pl-pds">"</span></span>],
  <span class="pl-ent">"plugins"</span>: [<span class="pl-s"><span class="pl-pds">"</span>transform-runtime<span class="pl-pds">"</span></span>],
  <span class="pl-ent">"env"</span>: {
    <span class="pl-ent">"test"</span>: {
      <span class="pl-ent">"presets"</span>: [<span class="pl-s"><span class="pl-pds">"</span>env<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>stage-2<span class="pl-pds">"</span></span>],
      <span class="pl-ent">"plugins"</span>: [<span class="pl-s"><span class="pl-pds">"</span>istanbul<span class="pl-pds">"</span></span>]
    }
  }
}
</pre></div>
<h3 dir="auto">Expected Behavior</h3>
<h4 dir="auto">when <code class="notranslate">modules</code> not set, default commonjs</h4>
<p dir="auto">module.js become</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="'use strict';

import _Object$defineProperty from 'babel-runtime/core-js/object/define-property';
import _Object$keys from 'babel-runtime/core-js/object/keys';
Object.defineProperty(exports, &quot;__esModule&quot;, {
  value: true
});

var _moduleSub = require('./module-sub');

_Object$keys(_moduleSub).forEach(function (key) {
  if (key === &quot;default&quot; || key === &quot;__esModule&quot;) return;

  _Object$defineProperty(exports, key, {
    enumerable: true,
    get: function get() {
      return _moduleSub[key];
    }
  });
});"><pre class="notranslate"><span class="pl-s">'use strict'</span><span class="pl-kos">;</span>

<span class="pl-k">import</span> <span class="pl-s1">_Object$defineProperty</span> <span class="pl-k">from</span> <span class="pl-s">'babel-runtime/core-js/object/define-property'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-s1">_Object$keys</span> <span class="pl-k">from</span> <span class="pl-s">'babel-runtime/core-js/object/keys'</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-k">var</span> <span class="pl-s1">_moduleSub</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'./module-sub'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-en">_Object$keys</span><span class="pl-kos">(</span><span class="pl-s1">_moduleSub</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">forEach</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">key</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">key</span> <span class="pl-c1">===</span> <span class="pl-s">"default"</span> <span class="pl-c1">||</span> <span class="pl-s1">key</span> <span class="pl-c1">===</span> <span class="pl-s">"__esModule"</span><span class="pl-kos">)</span> <span class="pl-k">return</span><span class="pl-kos">;</span>

  <span class="pl-en">_Object$defineProperty</span><span class="pl-kos">(</span><span class="pl-s1">exports</span><span class="pl-kos">,</span> <span class="pl-s1">key</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
    <span class="pl-c1">enumerable</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
    <span class="pl-en">get</span>: <span class="pl-k">function</span> <span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-k">return</span> <span class="pl-s1">_moduleSub</span><span class="pl-kos">[</span><span class="pl-s1">key</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><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<h4 dir="auto">when <code class="notranslate">modules</code> is set to false</h4>
<p dir="auto">common.js become</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import _typeof from &quot;babel-runtime/helpers/typeof&quot;;
var x = typeof arg === &quot;undefined&quot; ? &quot;undefined&quot; : _typeof(arg);
module.exports = x;"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">_typeof</span> <span class="pl-k">from</span> <span class="pl-s">"babel-runtime/helpers/typeof"</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-k">typeof</span> <span class="pl-s1">arg</span> <span class="pl-c1">===</span> <span class="pl-s">"undefined"</span> ? <span class="pl-s">"undefined"</span> : <span class="pl-en">_typeof</span><span class="pl-kos">(</span><span class="pl-s1">arg</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">x</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">In a project mixed with commonjs files and ES module files with <code class="notranslate">export * </code><br>
babel generates <code class="notranslate">import</code> and <code class="notranslate">exports</code>, this will results webpack 2 rename <code class="notranslate">exports</code> to <code class="notranslate">__webpack_exports__</code>, final results <code class="notranslate">exports is not defined</code></p>
<p dir="auto">example code generated by webpack with content mixed with <code class="notranslate">exports</code> and <code class="notranslate">import</code></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/***/ (function(module, __webpack_exports__, __webpack_require__) {

&quot;use strict&quot;;
Object.defineProperty(__webpack_exports__, &quot;__esModule&quot;, { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_define_property__ = __webpack_require__(&quot;liLe&quot;);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_define_property___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_define_property__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_object_keys__ = __webpack_require__(&quot;ZLEe&quot;);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_object_keys___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_object_keys__);

Object.defineProperty(exports, &quot;__esModule&quot;, {
    value: true
});"><pre class="notranslate"><span class="pl-c">/***/</span> <span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">module</span><span class="pl-kos">,</span> <span class="pl-s1">__webpack_exports__</span><span class="pl-kos">,</span> <span class="pl-s1">__webpack_require__</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>

<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">__webpack_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-c">/* harmony import */</span> <span class="pl-k">var</span> <span class="pl-s1">__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_define_property__</span> <span class="pl-c1">=</span> <span class="pl-s1">__webpack_require__</span><span class="pl-kos">(</span><span class="pl-s">"liLe"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">/* harmony import */</span> <span class="pl-k">var</span> <span class="pl-s1">__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_define_property___default</span> <span class="pl-c1">=</span> <span class="pl-s1">__webpack_require__</span><span class="pl-kos">.</span><span class="pl-en">n</span><span class="pl-kos">(</span><span class="pl-s1">__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_define_property__</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">/* harmony import */</span> <span class="pl-k">var</span> <span class="pl-s1">__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_object_keys__</span> <span class="pl-c1">=</span> <span class="pl-s1">__webpack_require__</span><span class="pl-kos">(</span><span class="pl-s">"ZLEe"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">/* harmony import */</span> <span class="pl-k">var</span> <span class="pl-s1">__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_object_keys___default</span> <span class="pl-c1">=</span> <span class="pl-s1">__webpack_require__</span><span class="pl-kos">.</span><span class="pl-en">n</span><span class="pl-kos">(</span><span class="pl-s1">__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_object_keys__</span><span class="pl-kos">)</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></pre></div>
<p dir="auto">related issues<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="200903569" data-permission-text="Title is private" data-url="https://github.com/webpack/webpack/issues/3974" data-hovercard-type="issue" data-hovercard-url="/webpack/webpack/issues/3974/hovercard" href="https://github.com/webpack/webpack/issues/3974">webpack/webpack#3974</a><br>
<a href="https://www.google.com.hk/search?newwindow=1&amp;safe=strict&amp;ei=I1AmWtK9Doaj8QX86amoCw&amp;q=exports+is+not+defined&amp;oq=exp&amp;gs_l=psy-ab.3.0.0i67k1j0j0i67k1l2j0j0i67k1l4j0.7698247.7698604.0.7699788.3.3.0.0.0.0.137.268.0j2.2.0....0...1c.1.64.psy-ab..1.2.267...0i131k1.0.WC-jJIZgzU8" rel="nofollow">https://www.google.com.hk/search?newwindow=1&amp;safe=strict&amp;ei=I1AmWtK9Doaj8QX86amoCw&amp;q=exports+is+not+defined&amp;oq=exp&amp;gs_l=psy-ab.3.0.0i67k1j0j0i67k1l2j0j0i67k1l4j0.7698247.7698604.0.7699788.3.3.0.0.0.0.137.268.0j2.2.0....0...1c.1.64.psy-ab..1.2.267...0i131k1.0.WC-jJIZgzU8</a></p>
<h3 dir="auto">Your Environment</h3>

<table role="table">
<thead>
<tr>
<th>software</th>
<th>version(s)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Babel</td>
<td>6.26.0 (babel-core 6.26.0) babel-cli</td>
</tr>
<tr>
<td>Babylon</td>
<td></td>
</tr>
<tr>
<td>node</td>
<td>v8.6.0</td>
</tr>
<tr>
<td>npm</td>
<td>5.5.1</td>
</tr>
<tr>
<td>Operating System</td>
<td>macOS high Siera</td>
</tr>
</tbody>
</table>
<p dir="auto">I am attempting to use transform-runtime in combination with code that uses the export * from 'x' statement. The code that is generated during transpilation includes an import statement for core-js' define-property. I'm using the es2015 preset, so I would expect that a require statement would be generated, not an import.</p>
<p dir="auto">Small sample project at <a href="https://gist.github.com/mdouglass/a6a5c5aae68ac03a92d3">https://gist.github.com/mdouglass/a6a5c5aae68ac03a92d3</a></p>