text: var webpack = require('webpack')
  var config = require('./webpack.base.conf')
  var HtmlWebpackPlugin = require('html-webpack-plugin')
  var TransferWebpackPlugin = require('transfer-webpack-plugin')
  var ExtractTextPlugin = require('extract-text-webpack-plugin')
  
  // eval-source-map is faster for development
  config.devtool = 'eval-source-map'
  
  // add hot-reload related code to entry chunks
  var polyfill = 'eventsource-polyfill'
  var devClient = './build/dev-client'
  Object.keys(config.entry).forEach(function (name, i) {
    var extras = i === 0 ? [polyfill, devClient] : [devClient]
    config.entry[name] = extras.concat(config.entry[name])
  })
  
  // necessary for the html plugin to work properly
  // when serving the html from in-memory
  config.output.publicPath = '/'
  
  config.plugins = (config.plugins || []).concat([
    // https://github.com/glenjamin/webpack-hot-middleware#installation--usage
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.HotModuleReplacementPlugin(),
    new webpack.NoErrorsPlugin(),
    //copy data folder
    new TransferWebpackPlugin(
      [
        // {from: 'src/data', to: '/app/data/'},
        // {from: 'src/assets/js', to: '/js/'},
        {from: 'src/assets/css', to: '/app/css/'}
      ]
    ),
    // https://github.com/ampedandwired/html-webpack-plugin
    new HtmlWebpackPlugin({
      filename: 'app/index.html',
      template: 'src/index.html',
      inject: true
    }),
    new ExtractTextPlugin("style.css")
  ])
  
  module.exports = config
  