text: const path = require('path');
  const webpack = require('webpack');
  const config = require('./webpack.base');
  
  // plugins
  const CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin;
  const DefinePlugin = webpack.DefinePlugin;
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  const OccurenceOrderPlugin = webpack.optimize.OccurenceOrderPlugin;
  
  
  module.exports = {
    cache: true,
    debug: true,
    devtool: 'source-map', // for faster builds use 'cheap-module-eval-source-map'
    output: config.output,
    resolve: config.resolve,
    postcss: config.postcss,
    sassLoader: config.sassLoader,
  
    entry: {
      main: [
        'webpack-dev-server/client?http://localhost:3000',
        config.entry.main
      ],
      vendor: config.entry.vendor
    },
  
    module: {
      loaders: [
        // expose jquery as $ or jQuery
        { test: /jquery\.js$/, loader: 'expose?$' },
        { test: /jquery\.js$/, loader: 'expose?jQuery' },
  
        {test: /\.html$/, loader: 'raw'},
        { test: /\.css$/,   loader: 'raw-loader' },
        {test: /\.scss$/, include: [path.resolve(__dirname, 'src/components')], loader: 'raw!postcss-loader!sass'},
        {test: /\.scss$/, include: [path.resolve(__dirname, 'src/styles')], loader: 'style!css!postcss-loader!sass'},
        {test: /\.ts$/, exclude: [/\.spec\.ts$/, /node_modules/], loader: 'ts'},
  
        { test: /bootstrap\/js\//, loader: 'imports?jQuery=jquery' },
  
        // Needed for the css-loader when bootstrap-webpack loads bootstrap's css.
        { test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,   loader: "url?limit=10000&minetype=application/font-woff" },
        { test: /\.(woff|woff2)$/, loader: "url?limit=10000&minetype=application/font-woff" },
        { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,    loader: "url?limit=10000&minetype=application/octet-stream" },
        { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,    loader: "file" },
        { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,    loader: "url?limit=10000&minetype=image/svg+xml" }
      ],
  
      noParse: config.module.noParse
    },
  
    plugins: [
      new DefinePlugin({
        'process.env.NODE_ENV': JSON.stringify('development')
      }),
      new OccurenceOrderPlugin(),
      new CommonsChunkPlugin({name: 'vendor', filename: 'vendor.js', minChunks: Infinity}),
      new CommonsChunkPlugin({name: 'common', filename: 'common.js'}),
      new HtmlWebpackPlugin({
        chunksSortMode: 'none',
        filename: 'index.html',
        hash: true,
        inject: 'body',
        template: './src/index.html'
      })
    ],
  
    devServer: {
      contentBase: './src',
      historyApiFallback: true,
      port: 3000,
      publicPath: '/',
      stats: {
        cached: true,
        cachedAssets: true,
        chunks: true,
        chunkModules: false,
        colors: true,
        hash: false,
        reasons: true,
        timings: true,
        version: false
      }
    }
  };
  