title: Using async/await with babel - require("babel-polyfill") line not at the top in built file
body: <p>I am trying to use ES2017 async/await syntax with Babel.
  In <code>package.json</code>, I have </p>
  
  <pre><code>"babel": {
      "plugins": [
        "babel-plugin-transform-async-to-generator"
      ],
      "presets": [
        "es2015"
      ]
    }
  
  //...
  
  "devDependencies": {
      "babel-cli": "^6.14.0",
      "babel-plugin-transform-async-to-generator": "^6.8.0",
      "babel-polyfill": "^6.13.0",
      "babel-preset-es2015": "^6.14.0"
    }
  </code></pre>
  
  <p>The code I am trying to work with is</p>
  
  <p><strong>src/index.js</strong></p>
  
  <pre><code>require("babel-polyfill");
  
  async function foo() {
    return 10;
  }
  </code></pre>
  
  <p>and my built file is</p>
  
  <p><strong>dist/build.js</strong></p>
  
  <pre><code>"use strict";
  
  var foo = function () {
    var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee() {
      return regeneratorRuntime.wrap(function _callee$(_context) {
        while (1) {
          switch (_context.prev = _context.next) {
            case 0:
              return _context.abrupt("return", 10);
  
            case 1:
            case "end":
              return _context.stop();
          }
        }
      }, _callee, this);
    }));
  
    return function foo() {
      return _ref.apply(this, arguments);
    };
  }();
  
  function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; }
  
  require("babel-polyfill");
  </code></pre>
  
  <p>While running the <em>build.js</em> I get this error
  <code>ReferenceError: regeneratorRuntime is not defined</code></p>
  
  <p><strong>However, in the <em>build.js</em>, if I move the <code>require("babel-polyfill");</code> line to the top, it works.</strong> But I can't manually do that every time.</p>
  
  <p>So, how to do I use the async/await syntax with babel?</p>