title: Importing a module from node_modules that is not compiled to es6
body: <p>So we created a es6 module, put it in a stash and declared it as a dependency to another repository. </p>
  
  <p>In package.json, we've included "search-service-redux-middleware": "git+<a href="http://stash.corp.web:7990/scm/blah/search-service-redux-middleware.git" rel="nofollow">http://stash.corp.web:7990/scm/blah/search-service-redux-middleware.git</a>".</p>
  
  <p>Which is fine, except that we get the following error when running the server:</p>
  
  <pre><code>Module parse failed: /blah/search-service-react-result/node_modules/search-service-redux-middleware/searchServiceMiddleware.js Line 1: Unexpected token You may need an appropriate loader to handle this file type.
  | import request from 'superagent';
  | 
  | export default (actionType, URL) =&gt; (store) =&gt; (next) =&gt; (action) =&gt; {
  </code></pre>
  
  <p>Which, as far as I can figure out, means that babel is not compiling all of the code to es6 - it's leaving out node_modules and using them as they are. So how can I make this work?</p>
  
  <p>Here is the webpack.config.js:</p>
  
  <pre><code>const path = require('path');
  const webpack = require('webpack');
  module.exports = {
  entry: [
      'webpack-dev-server/client?http://localhost:8080',
      'webpack/hot/only-dev-server',
      './app/index.jsx'
  ],
  module: {
      loaders: [{
          test: /\.jsx?$/,
          exclude: /node_modules/,
          loader: 'babel-loader'
  
      }]
  },
  resolve: {
      extensions: ['', '.js', '.jsx']
  },
  output: {
      path: path.join(__dirname, 'dist'),
      publicPath: '/',
      filename: 'bundle.js'
  },
  devServer: {
      contentBase: './dist',
      hot: true
  },
  devtool: 'source-map',
  plugins: [
      new webpack.HotModuleReplacementPlugin()
  ]
  };  
  </code></pre>