title: Import React from 'react' results in Uncaught SyntaxError: Unexpected identifier
body: <p>I've installed webpack 3 along with babel and my entry <code>index.js/bundle.js</code> will build and run, which I've tested with ES7/8 features, however imports won't work and result in <code>Uncaught SyntaxError: Unexpected identifier</code>. I've tried putting the babel config in the <code>package.json</code> as well as in a separate <code>.babelrc</code> file in my app root directory but I still get the error when trying to import. Am I missing a package or setting?</p>
  
  <p><strong>index.js</strong> (works)</p>
  
  <pre><code>// does not work
  // import React from 'react' 
  
  // works
  const object1 = {
    a: 'somestring',
    b: 42,
    c: false
  };
  
  console.log(Object.values(object1));
  </code></pre>
  
  <p><strong>webpack.config.js</strong></p>
  
  <pre><code>const path = require('path')
  
  module.exports = {
    context: path.resolve(__dirname, 'app/assets/javascripts/source'),
    entry: './index.js',
    output: {
      filename: 'bundle.js',
      path: path.resolve(__dirname, 'app/assets/javascripts/webpack')
    },
    module: {
      rules: [
        {
          test: /\.js$/,
          exclude: /node_modules/,
          use: {
            loader: 'babel-loader',
            options: {
              presets: ['@babel/preset-env']
            }
          }
        }
      ]
    }
  }
  </code></pre>
  
  <p><strong>.babelrc</strong></p>
  
  <pre><code>{
    "presets": ["env", "react"]
  }
  </code></pre>
  
  <p><strong>package.json</strong></p>
  
  <pre><code>}
    ...
    "license": "MIT",
    "scripts": {
      "build": "webpack",
    },
    "babel": {
      "presets": [
        "env",
        "react"
      ]
    },
    "devDependencies": {
      "babel-core": "^6.26.0",
      "babel-loader": "^7.1.2",
      "babel-preset-env": "^1.6.1",
      "babel-preset-react": "^6.24.1",
      "prop-types": "^15.6.0",
      "react": "^16.2.0",
      "react-dom": "^16.2.0",
      "webpack": "^3.10.0",
      "webpack-dev-server": "^2.11.1"
    }
  }
  </code></pre>