title: Webpack: ES6 syntax gives Module build failed: SyntaxError: Unexpected token
body: <p>I'm trying to use an example of fixed-data-table, and bundle it with webpack.</p>
  
  <p>I'm using babel-loader and my code otherwise bundles without issues.</p>
  
  <p>Running <code>webpack</code> points to an error which to my knowledge is a part of ES6 syntax(not ES5) ... The <code>...</code> , such as here:</p>
  
  <p><code>render() {
          var {sortDir, children, ...props} = this.props;</code></p>
  
  <p>the <code>...props</code> specifically.</p>
  
  <p>Here's my webpack config:</p>
  
  <pre><code>"use strict";
  
  var webpack = require("webpack");
  
  module.exports = {
      entry: {
          app: './app.js',
          vendor: ["fixed-data-table","react","react-dom","jquery", "bootstrap", "vis", "chart.js"],
      },
      output: { path: "./", filename: 'bundle.js' },
  
      plugins: [
          new webpack.optimize.CommonsChunkPlugin(/* chunkName= */"vendor", /* filename= */"vendor.bundle.js"),
          new webpack.ProvidePlugin({
              $: "jquery",
              jQuery: "jquery"
          })
      ],
  
      module: {
          loaders: [
              {
                  test: /.js?$/,
                  loader: 'babel-loader',
                  exclude: /node_modules/,
                  query: {
                      presets: ['es2015', 'react']
                  }
              }
          ]
      },
  };
  </code></pre>
  
  <p>I'm using es2015 and react as presets and loading with babel-loader. How come it's throwing a syntax error when it's supposed to understand and process ES6 syntax?</p>
  
  <p>Here's my Package.json. Do I need to upgrade some of the versions possibly?</p>
  
  <pre><code>{
    "name": "test",
    "version": "1.0.0",
    "main": "main.js",
    "scripts": {
      "test": "echo \"Error: no test specified\" &amp;&amp; exit 1"
    },
    "author": "",
    "license": "ISC",
    "devDependencies": {
      "babel-core": "^6.3.17",
      "babel-loader": "^6.2.0",
      "babel-preset-es2015": "^6.3.13",
      "babel-preset-react": "^6.3.13",
      "babel-runtime": "^6.3.19",
      "webpack": "^1.12.9"
    },
    "dependencies": {
      "bootstrap": "^3.3.7",
      "chart.js": "^2.4.0",
      "fixed-data-table": "^0.6.0",
      "jquery": "^3.1.0",
      "react": "^0.14.3",
      "react-dom": "^0.14.3",
      "vis": "^4.17.0"
    },
    "description": ""
  }
  </code></pre>