title: Babel loader error: rest/spread operator not understood
body: <p>When I try to run my webpack bundle, I get this console error:</p>
  
  <pre><code>BabelLoaderError: SyntaxError: Unexpected token (113:19)
  
    111 | 
    112 | const render = () =&gt; ReactDOM.render(
  &gt; 113 |    &lt;TodoApp todos={...store.getState()}/&gt;,
        |                    ^
    114 |    document.getElementById("root")
    115 | )
    116 | 
  </code></pre>
  
  <p>So the spread operator syntax is not understood. However, I have installed the babel-stage-2 preset which I have included in my loaders in <code>webpack.config.js</code>, as follows:</p>
  
  <pre><code>module: {
          loaders: [
              {
                 test: path.join(__dirname, 'public'),
                 loader: ['babel-loader'],
                 query: {
                   presets: debug ? ['react', 'es2015', 'react-hmre', 'stage-2'] : ['react', 'es2015', 'stage-2']
                 }
              }
          ]
      }
  </code></pre>
  
  <p>I also tried installing <code>babel-plugin-transform-object-rest-spread</code> and adding to <code>.babelrc</code>:</p>
  
  <pre><code>{
    "plugins": ["transform-object-rest-spread"]
  }
  </code></pre>
  
  <p>Still receiving the same error. </p>
  
  <p>Any help appreciated!</p>