title: Error using babel-relay-plugin
body: <p>I stumbled upon an error while using babel-relay-plugin.</p>
  
  <p>When I require babel-relay-plugin module and export the output with my graphql schema and call it in my webpack list of babel plugins as a path works.</p>
  
  <pre><code>// webpack/plugins/babel-relay-plugin.js
  var babelRelayPlugin = require('babel-relay-plugin');
  var schema = require('./../../cloud/data/schema.json');
  
  module.exports = babelRelayPlugin(schema.data);
  
  
  // webpack/pro.config.js
      module.exports = [
        {
          module: {
            loaders: [
              {
                test: /\.js$/,
                exclude: /node_modules/,
                loader: 'babel',
                query: {
                  plugins: [
                    './webpack/plugins/babel-relay-plugin'
                  ]
                }
              }
            ]
          }
  
      }
  ]
  </code></pre>
  
  <p>But when I create the plugin in the same file as this:</p>
  
  <pre><code>// webpack/pro.config.js
  var BabelRelayPlugin = require('babel-relay-plugin');
  var schema = require('./../cloud/data/schema.json').data;
  
  module.exports = [
    {
      name: 'server',
      target: 'node',
      devtool: 'cheap-module-source-map',
      entry: cloudPath,
      output: {
        path: buildPath,
        filename: 'index.js'
      },
      module: {
        loaders: [
          {
            test: /\.js$/,
            exclude: /node_modules/,
            loader: 'babel',
            query: {
              plugins: [
                new BabelRelayPlugin(schema)
              ]
            }
          }
        ]
      }
    }
  ]
  </code></pre>
  
  <p>It throws this error stack:</p>
  
  <pre><code>ERROR in ./cloud/index.js
      Module build failed: TypeError: Cannot read property '__esModule' of null
          at Function.normalisePlugin (/Users/AJ/Desktop/winebox/app/node_modules/babel-core/lib/transformation/file/options/option-manager.js:156:20)
          at /Users/AJ/Desktop/winebox/app/node_modules/babel-core/lib/transformation/file/options/option-manager.js:197:30
          at Array.map (native)
          at Function.normalisePlugins (/Users/AJ/Desktop/winebox/app/node_modules/babel-core/lib/transformation/file/options/option-manager.js:173:20)
          at OptionManager.mergeOptions (/Users/AJ/Desktop/winebox/app/node_modules/babel-core/lib/transformation/file/options/option-manager.js:271:36)
          at OptionManager.init (/Users/AJ/Desktop/winebox/app/node_modules/babel-core/lib/transformation/file/options/option-manager.js:416:10)
          at File.initOptions (/Users/AJ/Desktop/winebox/app/node_modules/babel-core/lib/transformation/file/index.js:191:75)
          at new File (/Users/AJ/Desktop/winebox/app/node_modules/babel-core/lib/transformation/file/index.js:122:22)
          at Pipeline.transform (/Users/AJ/Desktop/winebox/app/node_modules/babel-core/lib/transformation/pipeline.js:42:16)
          at transpile (/Users/AJ/Desktop/winebox/app/node_modules/babel-loader/index.js:14:22)
          at Object.module.exports (/Users/AJ/Desktop/winebox/app/node_modules/babel-loader/index.js:88:12)
  </code></pre>
  
  <p>Any pointers as to how fix this inside the same file would be awesome. Thanks in advance.</p>
  
  <p>All my packages are up-to-date an I already asked and it's not a Relay-side problem.</p>