text: var path = require('path');
  var webpack = require('webpack');
  
  module.exports = function (env) {
  
    env = env || {};
    var isProd = env.NODE_ENV === 'production';
  
    // Setup base config for all environments
    var config = {
      entry: {
        main: './Client/js/main'
      },
      output: {
        path: path.resolve(__dirname, 'wwwroot/dist'),
        filename: '[name].js'
      },
      devtool: 'eval-source-map',
      resolve: {
        extensions: ['.ts', '.tsx', '.js', '.jsx']
      },
      plugins: [
        new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' })
      ],
      module: {
        rules: [
          { test: /\.css?$/, use: ['style-loader', 'css-loader'] },
          { test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' },
          { test: /\.(png|woff|woff2|eot|ttf|svg)(\?|$)/, use: 'url-loader?limit=100000' }
        ]
      }
    }
  
    // Alter config for prod environment
    if (isProd) {
      config.devtool = 'source-map';
      config.plugins = config.plugins.concat([
        new webpack.optimize.UglifyJsPlugin({
          sourceMap: true
        })
      ]);
    }
  
    return config;
  };