MSK Institute LogoMSK.Institute
HomeCourses
Book Free Demo➔Sign In
Free Demo➔
MSK Institute LogoMSK.Institute

Leading computer training academy in Shikohabad for software engineering, Python, web development, and digital literacy.

ISO 9001:2015 Certified Center
Follow & Connect
4.9

Programs & Admissions

  • All CoursesCatalog
  • Learning PathsRoadmaps
  • Student ProjectsShowcase
  • Live Classes & ScheduleLive
  • Upcoming Batches
  • Campuses & LocationsHub
  • Verify Certificates
  • Book Free Demo Class

Resources & Tools

  • Free Online Mock TestsAll Tests
  • NIELIT CCC Mock TestFree
  • Course & Career FinderQuiz
  • Study Material Hub
  • All MSK ToolsHub
  • Keyboard ShortcutsNew
  • TypeQuest Speed LabTyping
  • MSK Code PlaygroundCode
  • Interactive Tutorials
  • Quick Cheatsheets

Institute & Contact

  • About MSK Institute
  • Careers & InternshipsHiring
  • Publications & Blogs
  • Gali No. 3, Near Gyan Jyoti Public School,
    Adarsh Nagar, Shikohabad, Uttar Pradesh 283135
  • +91 83930 42166
  • mskshikohabad@gmail.com
  • Hours:Mon – Sat: 8:00 AM – 7:00 PM | Sun: 10:00 AM – 2:00 PM
  • 4.9 ★(38 Google Reviews)
© 2026 MSK Institute. All rights reserved.•Privacy Policy•Terms of Service•Disclaimer•Contact Us

Shikohabad's Leading Computer & Coding Academy

Home
Courses
Live
Material
Micro-Frontend Architectures and Module Federation0%
Study Materials
React.js for AdvancedProgress 0%
1.1Control Props and Inversion of Control Pattern1.2State Reducer Pattern in Advanced React1.3Prop Getters and Flexible Design Systems1.4Headless UI Architecture and Accessibility Primitives
16.1Micro-Frontend Architectures and Module Federation16.2Host and Remote Container Configuration16.3Cross-Application State Sharing and Event Buses
HomeTutorialsReact.js for AdvancedMicro-Frontend Architectures and Module Federation
Host and Remote Container Configuration

Micro-Frontend Architectures and Module Federation

Beginner12 min read•Updated: 2026-11-18•By Er. Sumit Kumar (MSK Institute)
Study MaterialsCheatsheet

As organizations scale to dozens of engineering squads, monolithic frontend codebases encounter severe bottlenecks: conflicting dependency upgrades, long CI/CD build queues, and tight deployment coupling. Micro-Frontend Architecture decomposes a monolithic web application into independent, semi-autonomous frontend applications that assemble dynamically in the browser. Webpack 5 Module Federation is the enterprise standard protocol enabling micro-frontends to share code and runtime components dynamically without npm publishing overhead.


1. Monolith vs Micro-Frontends

1Monolithic Frontend:
2[ Squad A: Billing ] + [ Squad B: Search ] + [ Squad C: Auth ]
3──► Bundled into 1 massive artifact
4──► 1 bug in Billing blocks Search squad's release!
5 
6Micro-Frontend Architecture:
7┌────────────────────────────────────────────────────────┐
8│ Host Shell (App Shell / Navigation / Global Context) │
9└───────┬────────────────────────┬───────────────────────┘
10 │ │
11 ▼ ▼
12┌──────────────────┐ ┌──────────────────┐
13│ Remote App 1 │ │ Remote App 2 │
14│ (Billing Squad) │ │ (Search Squad) │
15│ Deploys to CDN A │ │ Deploys to CDN B │
16└──────────────────┘ └──────────────────┘

2. Core Concepts of Webpack Module Federation

  • Host (Shell): The parent application that initializes the root DOM and consumes external modules.
  • Remote: An independent application that exposes specific components, state hooks, or routes for consumption by other applications.
  • Shared Dependencies: Libraries (such as react, react-dom, @apollo/client) loaded once as singletons to prevent multiple copies from bloating browser memory.

3. Remote Container Webpack Configuration

The Remote application exposes its internal components via ModuleFederationPlugin:

1// remote-billing/webpack.config.js
2const { ModuleFederationPlugin } = require("webpack").container;
3const deps = require("./package.json").dependencies;
4 
5module.exports = {
6 plugins: [
7 new ModuleFederationPlugin({
8 name: "billing_remote",
9 filename: "remoteEntry.js", // The manifest file consumed by hosts
10 exposes: {
11 // Expose component for external consumption
12 "./InvoiceWidget": "./src/components/InvoiceWidget",
13 "./BillingSummary": "./src/components/BillingSummary",
14 },
15 shared: {
16 ...deps,
17 react: { singleton: true, requiredVersion: deps.react },
18 "react-dom": { singleton: true, requiredVersion: deps["react-dom"] },
19 },
20 }),
21 ],
22};

4. Host Shell Webpack Configuration

The Host application declares the location of the remote container:

1// host-shell/webpack.config.js
2const { ModuleFederationPlugin } = require("webpack").container;
3const deps = require("./package.json").dependencies;
4 
5module.exports = {
6 plugins: [
7 new ModuleFederationPlugin({
8 name: "host_shell",
9 remotes: {
10 // Points to deployed manifest of remote
11 billing_remote: "billing_remote@https://billing.enterprise.com/remoteEntry.js",
12 },
13 shared: {
14 ...deps,
15 react: { singleton: true, requiredVersion: deps.react },
16 "react-dom": { singleton: true, requiredVersion: deps["react-dom"] },
17 },
18 }),
19 ],
20};

5. Dynamic Consumption in React Host

The Host imports the federated component just like any other lazy-loaded component:

1import React, { Suspense, lazy } from "react";
2 
3// Dynamically imported across the internet from billing CDN!
4const RemoteInvoiceWidget = lazy(() => import("billing_remote/InvoiceWidget"));
5 
6export function HostDashboard() {
7 return (
8 <div className="p-8 bg-slate-900 min-h-screen text-white">
9 <h1 className="text-2xl font-bold mb-6">Host Shell Portal</h1>
10 
11 <Suspense fallback={<div className="p-6 bg-slate-800 rounded animate-pulse">Streaming remote billing chunk...</div>}>
12 <RemoteInvoiceWidget organizationId="org_881" />
13 </Suspense>
14 </div>
15 );
16}

Interactive Quiz• Knowledge Check

Practice Quiz

Question 1
What primary organizational problem does a Micro-Frontend architecture solve?
Question 2
What is the purpose of remoteEntry.js in Webpack Module Federation?
Question 3
Why is singleton: true essential when configuring shared: ['react'] in Module Federation?
Question 4
How does a host application consume a federated remote component?
Question 5
What happens if a remote micro-frontend fails to load due to a CDN outage?
Next Lesson

Host and Remote Container Configuration

Continue learning with hands-on practice, examples, and exercises in the upcoming topic.

Related Lessons

Previous LessonNext Lesson
RTL (Right-to-Left) Language Layout SupportHost and Remote Container Configuration

Practice Quiz

Test your understanding of this lesson with 5 questions. Each question has one correct answer.

Mentor-Led Practical Training

Master React.js for Advanced with Hands-On Projects

Practice in live mentor-led sessions with real projects, mock tests, and verifiable certification at MSK Institute.

View Full CourseBook Free Demo
PreviousNext
PreviousPrevNext