text: const webpack = require('webpack');
  const HtmlWebPackPlugin = require('html-webpack-plugin');
  const dotenv = require('dotenv');
  
  const env = dotenv.config().parsed;
  const envKeys = Object.keys(env).reduce((prev, next) => {
    prev[`process.env.${next}`] = JSON.stringify(env[next]) || {};
    return prev;
  }, {});
  
  module.exports = {
    devtool: 'eval-source-map',
    // entry: ['babel-polyfill'],
    output: {
      publicPath: '/',
    },
    module: {
      rules: [
        {
          enforce: 'pre',
          test: /\.(js|jsx)$/,
          exclude: /node_modules/,
          use: ['eslint-loader'],
        },
        {
          test: /\.(js|jsx)$/,
          exclude: /node_modules/,
          use: {
            loader: 'babel-loader',
          },
        },
        {
          test: /\.css$/,
          loaders: ['style-loader', 'css-loader'],
        },
        {
          test: /\.html$/,
          use: [
            {
              loader: 'html-loader',
              options: { minimize: false },
            },
          ],
        },
        {
          test: /\.(jpe?g|png|gif|ico|svg)$/i,
          use: 'file-loader',
        },
      ],
    },
    resolve: {
      extensions: ['.js', '.jsx', '.json'],
    },
    target: 'web',
    devServer: {
      historyApiFallback: true,
      port: 8081,
    },
    plugins: [
      new HtmlWebPackPlugin({
        template: './src/index.html',
        filename: './index.html',
      }),
      new webpack.DefinePlugin(envKeys),
    ],
  };
  