text: var path = require('path');
  var webpack = require('webpack');
  var HtmlWebpackPlugin = require('html-webpack-plugin');
  var ExtractTextPlugin = require('extract-text-webpack-plugin');
  
  module.exports = {
    context: path.join(__dirname, 'src'),
    resolve: {
      extensions: ['.js', '.ts', '.tsx', '.css'],
    },
    entry: {
      app: './index.tsx',
      vendor: [
        'core-js',
        'bootstrap',
        'react',
        'react-dom',
        'react-router',
        'toastr',
        'react-addons-shallow-compare',
        'react-virtualized',
        'react-infinite-calendar',
        'react-addons-css-transition-group',
        'moment',
        'react-modal',
        'validate.js',
        'redux',
        'react-redux',
        'redux-thunk',
      ],
      vendorStyles: [
        '../node_modules/bootstrap/dist/css/bootstrap.css',
        '../node_modules/toastr/build/toastr.css',
        '../node_modules/react-virtualized/styles.css',
        '../node_modules/react-infinite-calendar/styles.css',
      ],
    },
    output: {
      path: path.join(__dirname, 'dist'),
      filename: '[chunkhash].[name].js',
    },
    module: {
      rules: [
        {
          test: /\.tsx?$/,
          exclude: /node_modules/,
          loader: 'awesome-typescript-loader',
        },
        // Load css from src with CSS Modules
        {
          test: /\.css$/,
          exclude: /node_modules/,
          loader: ExtractTextPlugin.extract({
            fallback: 'style-loader',
            use: {
              loader: 'css-loader',
              options: {
                modules: true,
                localIdentName: '[name]__[local]___[hash:base64:5]',
                camelCase: true,
              },
            },
          }),
        },
        // Load css from node_modules
        {
          test: /\.css$/,
          include: /node_modules/,
          loader: ExtractTextPlugin.extract({
            fallback: 'style-loader',
            use: 'css-loader',
          }),
        },
        // Loading glyphicons => https://github.com/gowravshekar/bootstrap-webpack
        // Using here url-loader and file-loader
        {
          test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/,
          loader: 'url-loader?limit=10000&mimetype=application/font-woff'
        },
        {
          test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
          loader: 'url-loader?limit=10000&mimetype=application/octet-stream'
        },
        {
          test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
          loader: 'file-loader'
        },
        {
          test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
          loader: 'url-loader?limit=10000&mimetype=image/svg+xml'
        },
      ],
    },
    // For development https://webpack.js.org/configuration/devtool/#for-development
    devtool: 'inline-source-map',
    devServer: {
      contentBase: path.join(__dirname, 'dist'),
      port: 8080,
      noInfo: true,
    },
    plugins: [
      // Caching vendors with manifest
      // https://webpack.js.org/guides/code-splitting-libraries/#manifest-file
      new webpack.optimize.CommonsChunkPlugin({
        names: ['vendor', 'manifest'],
      }),
      new ExtractTextPlugin({
        filename: '[name].css',
        disable: false,
        allChunks: true,
      }),
      //Generate index.html in /dist => https://github.com/ampedandwired/html-webpack-plugin
      new HtmlWebpackPlugin({
        filename: 'index.html', //Name of file in ./dist/
        template: 'index.html', //Name of template in ./src
  			hash: true
      }),
      //Expose jquery used by bootstrap
      new webpack.ProvidePlugin({
        $: "jquery",
        jQuery: "jquery"
      }),
    ],
  }
  