title: How to setup TypeScript + Babel + Webpack?
body: <p>I have these dependencies:</p>
  <pre><code>&quot;devDependencies&quot;: {
    &quot;@types/node&quot;: &quot;^4.0.27-alpha&quot;,
    &quot;babel-core&quot;: &quot;^6.10.4&quot;,
    &quot;babel-loader&quot;: &quot;^6.2.4&quot;,
    &quot;babel-polyfill&quot;: &quot;^6.9.1&quot;,
    &quot;babel-preset-es2015&quot;: &quot;^6.9.0&quot;,
    &quot;babel-preset-stage-0&quot;: &quot;^6.5.0&quot;,
    &quot;ts-loader&quot;: &quot;^0.8.2&quot;,
    &quot;typescript&quot;: &quot;^2.0.0&quot;,
    &quot;webpack&quot;: &quot;^1.13.1&quot;
  }
  </code></pre>
  <p>.babelrc:</p>
  <pre><code>{
    &quot;presets&quot;: [
      &quot;es2015&quot;,
      &quot;stage-0&quot;
    ]
  }
  </code></pre>
  <p>tsconfig.json:</p>
  <pre><code>{
      &quot;compilerOptions&quot;: {
          &quot;module&quot;: &quot;commonjs&quot;,
          &quot;target&quot;: &quot;es6&quot;,
          &quot;noImplicitAny&quot;: false,
          &quot;sourceMap&quot;: false,
          &quot;outDir&quot;: &quot;built&quot;
      },
      &quot;exclude&quot;: [
          &quot;node_modules&quot;
      ]
  }
  </code></pre>
  <p>webpack.config.js:</p>
  <pre><code>module.exports = {
    entry: ['babel-polyfill', './src/'],
    output: {
      path: __dirname,
      filename: './built/bundle.js',
    },
    resolve: {
      modulesDirectories: ['node_modules'],
      extensions: ['', '.js', '.ts'],
    },
    module: {
      loaders: [{
        test: /\.tsx?$/, loaders: ['ts-loader', 'babel-loader'], exclude: /node_modules/
      }],
    }
  };
  </code></pre>
  <p>/src/index.ts:</p>
  <pre><code>async function foo() {
    const value = await bar();
    console.log(value);
  }
  
  function bar() {
    return new Promise((resolve, reject) =&gt; {
      return resolve(4);
    });
  }
  
  (async function run() {
    await foo();
  }());
  </code></pre>
  <p>With this setup it does work, I can build and run it (logs 4 correctly). However I'm always getting some errors on Webpack:</p>
  <pre><code>ERROR in ./src/index.ts
  (4,32): error TS2304: Cannot find name 'regeneratorRuntime'.
  
  ERROR in ./src/index.ts
  (6,12): error TS2304: Cannot find name 'regeneratorRuntime'.
  
  ERROR in ./src/index.ts
  (31,451): error TS2346: Supplied parameters do not match any signature of call target.
  
  ERROR in ./src/index.ts
  (40,33): error TS2304: Cannot find name 'regeneratorRuntime'.
  
  ERROR in ./src/index.ts
  (41,12): error TS2304: Cannot find name 'regeneratorRuntime'.
  </code></pre>
  <p>It seems it has something to do with <code>babel-polyfill</code>. What am I missing?</p>