const path = require('path');
const webpack = require('webpack');

const { PORT, HOST, BASENAME } = process.env;

// set defaults
const port = +PORT || 8080;
const host = HOST || 'localhost';
const publicPath = BASENAME || '/';

module.exports = {
  entry: {
    app: './src/main',
  },

  devtool: 'eval',

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

  module: {
    rules: [
      {
        test: /\.s?(a|c)ss$/,
        use: [
          'style-loader',
          {
            loader: 'css-loader',
            options: {
              importLoaders: 1,
            },
          },
          'sass-loader',
        ],
      },
    ],
  },

  plugins: [
  ],

  devServer: {
    historyApiFallback: true,
    stats: 'minimal',
    publicPath,
    port,
    host,
  },
};

@@ -722,16 +722,100 @@
 gins: %5B%0A
+    new webpack.HotModuleReplacementPlugin(),%0A    new webpack.NamedModulesPlugin(),%0A
   %5D,%0A%0A  
@@ -857,16 +857,31 @@
 : true,%0A
+    hot: true,%0A
     stat

enable HMR