const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {

  entry: [
    'webpack-dev-server/client?http://localhost:8080',
    'webpack/hot/only-dev-server',
    './app/index.js'
  ],

  output: {
    path: path.resolve(__dirname, 'dist'),
    publicPath: '/',
    filename: 'index_bundle.js'
  },

  module: {
    rules: [
      {test: /\.(js|jsx)$/, exclude: /node_modules/,
         use: {
           loader: 'babel-loader',
           options: {
              presets: ['env', 'react']
            }
          }
        },
      {test: /\.css$/, use: ['style-loader', 'css-loader']}
    ]
  },

  devServer: {
    hot: true,
    contentBase: path.resolve(__dirname, 'dist'),
    publicPath: '/'
  },

  plugins: [
    new HtmlWebpackPlugin({
      template: './app/index.html'
    }),
    new webpack.HotModuleReplacementPlugin()
  ]
}

const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {

  entry: [
    'webpack-dev-server/client?http://localhost:8080',
    'webpack/hot/only-dev-server',
    './app/index.js'
  ],

  output: {
    path: path.resolve(__dirname, 'dist'),
    publicPath: '/',
    filename: '[name].bundle.js'
  },

  module: {
    rules: [
      {test: /\.(js|jsx)$/, exclude: /node_modules/,
         use: {
           loader: 'babel-loader',
           options: {
              presets: ['env', 'react']
            }
          }
        },
      {test: /\.css$/, use: ['style-loader', 'css-loader']}
    ]
  },

  devServer: {
    hot: true,
    contentBase: path.resolve(__dirname, 'dist'),
    publicPath: '/'
  },

  plugins: [
    new HtmlWebpackPlugin({
      template: './app/index.html'
    }),
    new webpack.HotModuleReplacementPlugin()
  ]
}

Use subsitution for bundle names
Use subsitution for bundle names
