title: TypeError of select2 with Webpack
body: <p>I have successfully bundled local copy of select2.js with several *.js files through Webpack. However, it always throw a TypeError which warns that e.select2 is not a function. Interestingly, if I require the select2.js from CDN, it works at the initial page load, but throws the same error after refreshing the page.</p>
  
  <p>This error never happened before I did the bundling.</p>
  
  <p>Can anyone please suggest? Thanks!</p>
  
  <p>By request, I'm sharing the the webpack.config.js below.</p>
  
  <pre><code>var path = require("path");
  var webpack = require('webpack');
  var BundleTracker = require('webpack-bundle-tracker');
  
  module.exports = {
  context: __dirname,
  
  entry: {
      annotation: './assets/js/annotation_index',
      subject: './assets/js/subject_index',
      highchart: './assets/js/highchart_index',
      protocol: './assets/js/protocol_index',
      subscription: './assets/js/subscription_index'
  },
  
  output: {
      path: path.resolve('./assets/bundles/'),
      filename: "[name].js",
  },
  
  externals: [
      require('webpack-require-http')
  ],
  
  plugins: [
      new BundleTracker({filename: './webpack-stats.json'})
  ],
  
  module: {
      loaders: [
          { test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel-loader', query: {compact: false} }, // to transform JSX into JS
      ],
  },
  
  resolve: {
      modulesDirectories: ['node_modules', './assets/js/annotation'],
      extensions: ['', '.js', '.jsx'],
      alias: { jquery: "./jquery"}
  },
  }
  </code></pre>