text: // shared config (dev and prod)
  const { resolve } = require("path");
  const webpack = require("webpack");
  const HtmlWebpackPlugin = require("html-webpack-plugin");
  const Dotenv = require("dotenv-webpack");
  
  module.exports = {
    resolve: {
      extensions: [".js", ".jsx", ".ts", ".tsx"],
      fallback: {
        url: require.resolve("url"),
        assert: require.resolve("assert"),
        crypto: require.resolve("crypto-browserify"),
        http: require.resolve("stream-http"),
        https: require.resolve("https-browserify"),
        os: require.resolve("os-browserify/browser"),
        stream: require.resolve("stream-browserify"),
        buffer: require.resolve("buffer/"),
      },
      alias: {
        process: "process/browser",
        components: resolve(__dirname, "../../src/components"),
        layouts: resolve(__dirname, "../../src/layouts"),
        containers: resolve(__dirname, "../../src/containers"),
        assets: resolve(__dirname, "../../src/assets"),
        pages: resolve(__dirname, "../../src/pages"),
        utils: resolve(__dirname, "../../src/utils"),
        enums: resolve(__dirname, "../../src/enums"),
      },
    },
    context: resolve(__dirname, "../../src"),
    module: {
      rules: [
        {
          test: [/\.jsx?$/, /\.tsx?$/],
          use: ["babel-loader"],
          exclude: /node_modules/,
        },
        {
          test: /\.css$/,
          use: ["style-loader", "css-loader"],
        },
        {
          test: /\.(scss|sass)$/,
          use: ["style-loader", "css-loader", "sass-loader"],
        },
        {
          test: /\.(jpe?g|png|gif|svg)$/i,
          use: [
            "file-loader?hash=sha512&digest=hex&name=img/[contenthash].[ext]",
            "image-webpack-loader?bypassOnDebug&optipng.optimizationLevel=7&gifsicle.interlaced=false",
          ],
        },
      ],
    },
    plugins: [
      new HtmlWebpackPlugin({ template: "index.html.ejs" }),
      new webpack.ProvidePlugin({
        Buffer: ["buffer", "Buffer"],
      }),
      new webpack.ProvidePlugin({
        process: "process/browser",
      }),
      new Dotenv(),
    ],
    externals: {
      react: "React",
      "react-dom": "ReactDOM",
    },
    performance: {
      hints: false,
    },
  };
  