text: 'use strict';
  
  const dotenv = require('dotenv');
  const webpack = require('webpack');
  const HTMLPlugin = require('html-webpack-plugin');
  const CleanPlugin = require('clean-webpack-plugin');
  const ExtractTextPlugin = require('extract-text-webpack-plugin');
  
  const production = process.env.NODE_ENV === 'production';
  
  dotenv.load();
  
  let plugins = [
    new ExtractTextPlugin('bundle.css'),
    new HTMLPlugin({template: `${__dirname}/app/index.html`}),
    new webpack.DefinePlugin({
      __API_URL__: JSON.stringify(process.env.API_URL),
      __DEBUG__: JSON.stringify(!production)
    })
  ]
  
  if (production) {
    plugins = plugins.concat([
      new webpack
        .optimize
        .UglifyJsPlugin({
          mangle: true,
          compress: {
            warnings: false
          }
        }),
      new CleanPlugin()
    ])
  }
  
  module.exports = {
    entry: `${__dirname}/app/index.js`,
    devtool: production
      ? false
      : 'eval',
    devServer: {
      host: "localhost", // Your Computer Name
      port: 8080
    },
    plugins,
    output: {
      path: 'build',
      filename: 'bundle.js'
    },
    sassLoader: {
      includePaths: [`${__dirname}/app/scss/`]
    },
    module: {
      loaders: [
        {
          test: /\.js$/,
          exclude: /node_modules/,
          loader: 'babel'
        }, {
          test: /\.html$/,
          loader: 'html'
        }, {
          test: /\.(woff|tt|svg|eot).*/,
          loader: 'url?limit=10000&name=fonts/[hash].[ext]'
        }, {
          test: /\.(jpg|jpeg|svg|bmp|tiff|gif|png|ico)$/,
          loader: 'url?limit=10000&name=images/[hash].[ext]'
        }, {
          test: /\.scss$/,
          loader: ExtractTextPlugin.extract('style', 'css!resolve-url!sass?sourceMap')
        }
      ]
    }
  }
  