text: const HtmlWebPackPlugin = require("html-webpack-plugin");
  const ModuleFederationPlugin = require("webpack/lib/container/ModuleFederationPlugin");
  
  const deps = require("./package.json").dependencies;
  module.exports = {
    output: {
      publicPath: "http://localhost:8082/",
    },
  
    resolve: {
      extensions: [".tsx", ".ts", ".jsx", ".js", ".json"],
    },
  
    devServer: {
      port: 8082,
    },
  
    module: {
      rules: [
        {
          test: /\.m?js/,
          type: "javascript/auto",
          resolve: {
            fullySpecified: false,
          },
        },
        {
          test: /\.css$/i,
          use: ["style-loader", "css-loader"],
        },
        {
          test: /\.(ts|tsx|js|jsx)$/,
          exclude: /node_modules/,
          use: {
            loader: "babel-loader",
            options: {
              presets: ["@babel/preset-react", "@babel/preset-typescript"],
            },
          },
        },
      ],
    },
  
    plugins: [
      new ModuleFederationPlugin({
        name: "app2",
        filename: "remoteEntry.js",
        library: { type: "var", name: "app2" },
        // remotes: {},
        exposes: {
          "./Feature": "./src/components/Feature",
          "./BasicComponent": "./src/components/BasicComponent",
        },
        shared: {
          ...deps,
          react: {
            singleton: true,
            requiredVersion: deps.react,
          },
          "react-dom": {
            singleton: true,
            requiredVersion: deps["react-dom"],
          },
          "@chakra-ui/react": {
            singleton: true,
            requiredVersion: deps["@chakra-ui/react"],
          },
          "@emotion/react": {
            singleton: true,
            requiredVersion: deps["@emotion/react"],
          },
          "@emotion/styled": {
            singleton: true,
            requiredVersion: deps["@emotion/styled"],
          },
          "framer-motion": {
            singleton: true,
            requiredVersion: deps["framer-motion"],
          },
        },
      }),
      new HtmlWebPackPlugin({
        template: "./src/index.html",
      }),
    ],
  };
  