<p dir="auto">With this code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="require('babel/polyfill');

function* g() {
    yield 1;
}"><pre class="notranslate"><code class="notranslate">require('babel/polyfill');

function* g() {
    yield 1;
}
</code></pre></div>
<p dir="auto">Babel gives:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="'use strict';

var marked0$0 = [g].map(regeneratorRuntime.mark);
require('babel/polyfill');

function g() {
    return regeneratorRuntime.wrap(function g$(context$1$0) {
        while (1) switch (context$1$0.prev = context$1$0.next) {
            case 0:
                context$1$0.next = 2;
                return 1;

            case 2:
            case 'end':
                return context$1$0.stop();
        }
    }, marked0$0[0], this);
}"><pre class="notranslate"><code class="notranslate">'use strict';

var marked0$0 = [g].map(regeneratorRuntime.mark);
require('babel/polyfill');

function g() {
    return regeneratorRuntime.wrap(function g$(context$1$0) {
        while (1) switch (context$1$0.prev = context$1$0.next) {
            case 0:
                context$1$0.next = 2;
                return 1;

            case 2:
            case 'end':
                return context$1$0.stop();
        }
    }, marked0$0[0], this);
}
</code></pre></div>
<p dir="auto">where <code class="notranslate">var marked0$0 = [g].map(regeneratorRuntime.mark);</code> appears before <code class="notranslate">require('babel/polyfill');</code>. That makes an error: <code class="notranslate">regeneratorRuntime undefined</code>.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="require(&quot;babel/polyfill&quot;);
function *hello () {};"><pre class="notranslate"><span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"babel/polyfill"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">function</span> <span class="pl-c1">*</span><span class="pl-s1">hello</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">After babelification:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;;

var hello = regeneratorRuntime.mark(function hello() {
  return regeneratorRuntime.wrap(function hello$(context$1$0) {
    while (1) switch (context$1$0.prev = context$1$0.next) {
      case 0:
      case &quot;end&quot;:
        return context$1$0.stop();
    }
  }, hello, this);
});

require(&quot;babel/polyfill&quot;);
;"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-s1">hello</span> <span class="pl-c1">=</span> <span class="pl-s1">regeneratorRuntime</span><span class="pl-kos">.</span><span class="pl-en">mark</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-s1">hello</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">regeneratorRuntime</span><span class="pl-kos">.</span><span class="pl-en">wrap</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-en">hello$</span><span class="pl-kos">(</span><span class="pl-s1">context$1$0</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">while</span> <span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span> <span class="pl-k">switch</span> <span class="pl-kos">(</span><span class="pl-s1">context$1$0</span><span class="pl-kos">.</span><span class="pl-c1">prev</span> <span class="pl-c1">=</span> <span class="pl-s1">context$1$0</span><span class="pl-kos">.</span><span class="pl-c1">next</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-k">case</span> <span class="pl-c1">0</span>:
      <span class="pl-k">case</span> <span class="pl-s">"end"</span>:
        <span class="pl-k">return</span> <span class="pl-s1">context$1$0</span><span class="pl-kos">.</span><span class="pl-en">stop</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-s1">hello</span><span class="pl-kos">,</span> <span class="pl-smi">this</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-en">require</span><span class="pl-kos">(</span><span class="pl-s">"babel/polyfill"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">;</span></pre></div>
<p dir="auto">This would result in <code class="notranslate">ReferenceError: regeneratorRuntime is not defined</code> was found when discussion this issue with <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/zeusdeux/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/zeusdeux">@zeusdeux</a></p>