text: const path = require("path");
  const HtmlWebpackPlugin = require("html-webpack-plugin");
  const webpack = require('webpack');
  
  module.exports = {
    entry: ['babel-polyfill', path.join(__dirname, "src/dapp")],
    output: {
      path: path.join(__dirname, "prod/dapp"),
      filename: "bundle.js"
    },
    module: {
      rules: [
        {   
          test: /\.css$/i,
          use: [
            "style-loader", "css-loader",
          ]},
      {
          test: /\.(js|jsx)$/,
          use: "babel-loader",
          exclude: /node_modules/
        },
        {
          test: /\.(png|svg|jpg|gif)$/,
          use: [
            'file-loader'
          ]
        },
        {
          test: /\.html$/,
          use: "html-loader",
          exclude: /node_modules/
        },
        {
          test: /\.(js|ts)$/,
          enforce: 'pre',
          use: ['source-map-loader'],
        }
      ]
    },
    plugins: [
      new HtmlWebpackPlugin({ 
        template: path.join(__dirname, "src/dapp/index.html")
      }),
      new webpack.EnvironmentPlugin({
        NODE_ENV: 'development',
        DEBUG: true}),
  
        new webpack.ProvidePlugin({
          process: 'process/browser',
        }),
        new webpack.ProvidePlugin({
          Buffer: ['buffer', 'Buffer'],
      }),
  
    
      
      
    ],
    resolve: {
      extensions: [".js"],
      fallback: {
        "util" : require.resolve("util/"),
        "crypto": require.resolve("crypto-browserify"),
        "stream": require.resolve("stream-browserify"),
        "assert": require.resolve("assert/"),
        "http": require.resolve("stream-http"),
        "https": require.resolve("https-browserify"),
        "url": require.resolve("url/"),
        "os": require.resolve("os-browserify/browser")
      }
    },
    devServer: {
      static: path.join(__dirname, "dapp"),
      port: 8000,
      devMiddleware: {
      stats: {
        children: true,
        errorDetails: true
      }
    }
    }
  };
  