title: @babel/polyfill (Babel 7 beta) causes a SyntaxError
body: <p><strong>Please don't mark this as a duplicate of any Babel <em>6</em> questions, because this is specifically about Babel <em>7</em>!</strong></p>
  
  <p>I'm trying out the new Babel 7 beta (<code>@babel/polyfill@7.0.0-beta.32</code> etc.) and I'm having troubles using <code>@babel/polyfill</code>.</p>
  
  <h2>Summary</h2>
  
  <ul>
  <li>When I build the project with Webpack, everything works fine.</li>
  <li>When I try to run it from the command-line, I get a SyntaxError.</li>
  </ul>
  
  <p>I probably just forgot something simple, but I can't for the life of me figure out what. Any ideas what the problem is?</p>
  
  <h2>System spec</h2>
  
  <ul>
  <li>macOS High Sierra Developer Beta 5</li>
  <li>Node 8.9.1</li>
  <li>NPM 5.5.1</li>
  </ul>
  
  <h2>Files</h2>
  
  <h3>.babelrc.js</h3>
  
  <pre><code>module.exports = {
    presets: [
      ['@babel/preset-env', { targets: { node: 6 } }],
      ['@babel/preset-stage-3'],
      ['@babel/preset-flow']
    ]
  }
  </code></pre>
  
  <h3>src/index.js</h3>
  
  <pre><code>require('@babel/polyfill')
  module.exports = require('./main')
  </code></pre>
  
  <h3>src/main.js</h3>
  
  <pre><code>import 'dotenv-safe/config'
  </code></pre>
  
  <h3>Command line</h3>
  
  <pre><code>$ node --trace-warnings ./src/index.js
  </code></pre>
  
  <h3>Error message</h3>
  
  <pre><code>import 'dotenv-safe/config'
  ^^^^^^
  
  SyntaxError: Unexpected token import
      at createScript (vm.js:80:10)
      at Object.runInThisContext (vm.js:139:10)
      at Module._compile (module.js:599:28)
      at Object.Module._extensions..js (module.js:646:10)
      at Module.load (module.js:554:32)
      at tryModuleLoad (module.js:497:12)
      at Function.Module._load (module.js:489:3)
      at Module.require (module.js:579:17)
      at require (internal/module.js:11:18)
      at Object.&lt;anonymous&gt; (/Users/deniz/Code/my-project/src/index.js:3:18)
  </code></pre>
  
  <h3>package.json</h3>
  
  <pre><code>{
    "name": "foobar",
    "private": true,
    "version": "1.0.0",
    "description": "lol",
    "main": "./dist/bundle.js",
    "module": "./src/main.js",
    "scripts": {
      "clean": "rimraf dist",
      "build": "webpack",
      "watch": "webpack -w",
      "flow": "flow",
      "flow-typed": "flow-typed",
      "dev": "node --trace-warnings ./src/index.js",
      "start": "node ./dist/bundle.js"
    },
    "devDependencies": {
      "@babel/cli": "^7.0.0-beta.32",
      "@babel/core": "^7.0.0-beta.32",
      "@babel/preset-env": "^7.0.0-beta.32",
      "@babel/preset-flow": "^7.0.0-beta.32",
      "@babel/preset-stage-3": "^7.0.0-beta.32",
      "babel-eslint": "^8.0.2",
      "babel-loader": "^8.0.0-beta.0",
      "dotenv-safe": "^4.0.4",
      "eslint": "^4.12.0",
      "eslint-config-prettier": "^2.9.0",
      "eslint-plugin-flowtype": "^2.39.1",
      "eslint-plugin-prettier": "^2.3.1",
      "flow-bin": "^0.59.0",
      "flow-typed": "^2.2.3",
      "prettier": "^1.8.2",
      "rimraf": "^2.6.2",
      "webpack": "^3.9.1"
    },
    "dependencies": {
      "@babel/polyfill": "^7.0.0-beta.32",
      "node-schedule": "^1.2.5"
    }
  }
  </code></pre>
  
  <h3>webpack.config.js</h3>
  
  <pre><code>const path = require('path')
  
  module.exports = {
    target: 'node',
    entry: ['./src/index.js'],
    output: {
      path: path.resolve(__dirname, 'dist'),
      filename: 'bundle.js'
    },
    module: {
      rules: [
        {
          test: /\.js$/,
          include: [path.resolve(__dirname, 'src')],
          loader: 'babel-loader'
        }
      ]
    },
    externals: [
      {
        mariasql: true,
        msnodesql: true,
        msnodesqlv8: true,
        mysql: true,
        mysql2: true,
        oracle: true,
        oracledb: true,
        'pg-query-stream': true,
        pg: true,
        sqlite3: true,
        'strong-oracle': true,
        tds: true
      }
    ],
    devtool: 'source-map'
  }
  </code></pre>