text: const webpack = require('webpack');
  const { resolve } = require('path');
  const HtmlWebpackPlugin = require('html-webpack-plugin');
  
  module.exports = {
  
    entry: [
      'react-hot-loader/patch',
      'webpack-dev-server/client?http://localhost:8080',
      'webpack/hot/only-dev-server',
      resolve(__dirname, "src", "index.jsx")
    ],
  
    output: {
      filename: 'app.bundle.js',
      path: resolve(__dirname, 'build'),
      publicPath: '/'
    },
  
    resolve: {
      extensions: ['.js', '.jsx']
    },
  
    devtool: '#source-map',
  
    devServer: {
      hot: true,
      contentBase: resolve(__dirname, 'build'),
      publicPath: '/'
    },
  
    module: {
      rules: [
        {
          test: /\.(gif|png|jpe?g|svg)$/i,
          use: [
            'file-loader',
            {
              loader: 'image-webpack-loader',
              options: {
                bypassOnDebug: true, // webpack@1.x
                disable: true, // webpack@2.x and newer
              },
            },
          ],
        },
        {
          test:/\.jsx?$/,
          enforce: "pre",
          loader: "eslint-loader",
          exclude: /node_modules/,
          options: {
            emitWarning: true,
            configFile: "./.eslintrc.json"
          }
        },
        {
          test: /\.jsx?$/,
          loader: "babel-loader",
          exclude: /node_modules/,
          options: {
            presets: [
              ["es2015", {"modules": false}],
              "react",
            ],
            plugins: [
              "react-hot-loader/babel"
            ]
          }
        }
      ],
    },
  
    plugins: [
      new webpack.HotModuleReplacementPlugin(),
      new webpack.NamedModulesPlugin(),
      new HtmlWebpackPlugin({
        template:'template.ejs',
        appMountId: 'react-app-root',
        title: 'Ben Kirby',
        filename: resolve(__dirname, "build", "index.html"),
      }),
    ]
  };
  