import { createModuleFederationConfig } from "@module-federation/modern-js";

export default createModuleFederationConfig({
  name: "aeroflot_flights",
  exposes: {
    "./OnlineBoard": "./src/mf/expose/OnlineBoard.tsx",
    "./Schedule": "./src/mf/expose/Schedule.tsx",
    "./FlightsMap": "./src/mf/expose/FlightsMap.tsx",
    "./PopularRequests": "./src/mf/expose/PopularRequests.tsx",
  },
  shared: {
    react: { singleton: true, requiredVersion: "^18.2.0" },
    "react-dom": { singleton: true, requiredVersion: "^18.2.0" },
  },
  // Disable DTS generation at build time. @module-federation/dts-plugin@2.3.3
  // fails against our strict tsconfig (exactOptionalPropertyTypes +
  // noUncheckedIndexedAccess) and logs a TYPE-001 error. Types for the
  // exposed modules are shipped to consumers via their own dev-time
  // toolchain; the runtime does not need them.
  dts: false,
});
