title: Load javascript in webpack
body: <p>I am new to javascript dev in general and webpack in particular. I want to use this chess board module (<a href="https://github.com/oakmac/chessboardjs/" rel="nofollow noreferrer">https://github.com/oakmac/chessboardjs/</a>) in my project. It sees to be exporting ChessBoard object. My project is using ES6, so I would love to be able to </p>
  
  <p><code>import { ChessBoard } from 'chessboard'</code></p>
  
  <p>or </p>
  
  <p><code>import ChessBoard from 'chessboard'</code></p>
  
  <p>I understand that I need some sort of loader for this. I have tried to add expose loader in the same way I use it for jQuery</p>
  
  <pre><code>{test: require.resolve("jquery"), loader: "expose?$!expose?jQuery"},
  {test: require.resolve("chessboard"), loader: "expose?ChessBoard!./vendor/chessboard/js/chessboard-0.3.0.min.js"}
  </code></pre>
  
  <p>But I get "Error: Cannot find module 'chessboard'" error. Same if I replace ChessBoard with $. Not sure what I am doing wrong. Is expose even the right loader for what I am trying to do?</p>
  
  <p>Here is my webpack config for reference (without the broken chessboard expose test)</p>
  
  <pre class="lang-js prettyprint-override"><code>var path = require('path');
  var HtmlWebpackPlugin = require('html-webpack-plugin')
  
  module.exports = {
    entry: ['webpack/hot/dev-server', path.resolve(__dirname, 'app/main.js')],
    output: {
      path: path.resolve(__dirname, 'build'),
      filename: 'bundle.js',
    },
    module: {
      loaders: [
        {test: require.resolve("jquery"), loader: "expose?$!expose?jQuery"},
        {test: /\.jsx?$/, exclude:  /(node_modules|bower_components)/, loader: 'babel', query: {presets: ['react', 'es2015']} }, 
        /* CSS loaders */
        {test: /\.css$/, loader: 'style!css'},
        {test: /\.less$/, loader: 'style!css!less'},
        /* font loaders for bootstrap */
        {test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&amp;mimetype=application/font-woff'},
        {test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&amp;mimetype=application/octet-stream'},
        {test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file'},
        {test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&amp;mimetype=image/svg+xml'},
      ],
    },
    plugins: [
      new HtmlWebpackPlugin({
        title: 'Test',
        inject: false,
        template: 'node_modules/html-webpack-template/index.ejs',
        appMountId: 'app',
        devServer: 'http://localhost:8080',
      })
    ]
  };
  </code></pre>