title: How to add a query to a webpack loader with multiple loaders?
body: <p>I have this Babel loader that's working</p>
  
  <pre><code>{ test: /\.jsx?$/, loader: 'babel', query: babelSettings, exclude: /node_modules/ },
  </code></pre>
  
  <p>But now I want a CoffeeScript loader but I want to pipe it through Babel to get the the fancy HMR stuff</p>
  
  <pre><code>{ test: /\.coffee$/, loader: 'babel!coffee', query: babelSettings, exclude: /node_modules/ },
  </code></pre>
  
  <p>This doesn't work though, and results in the following error.</p>
  
  <blockquote>
    <p>Error: Cannot define 'query' and multiple loaders in loaders list</p>
  </blockquote>
  
  <p>Any idea how to define the query just for the Babel part of the loader chain? The query is a complicated object and I don't think I can encode it.</p>
  
  <pre><code>var babelSettings = { stage: 0 };
  
  if (process.env.NODE_ENV !== 'production') {
    babelSettings.plugins = ['react-transform'];
    babelSettings.extra = {
      'react-transform': {
        transforms: [{
          transform: 'react-transform-hmr',
          imports: ['react'],
          locals: ['module']
        }, {
          transform: 'react-transform-catch-errors',
          imports: ['react', 'redbox-react']
        }]
        // redbox-react is breaking the line numbers :-(
        // you might want to disable it
      }
    };
  }
  </code></pre>