You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: TestArena/Blog/React/ModuleFederationDemo.razor
+21-4Lines changed: 21 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -120,8 +120,17 @@ module-federation-demo/
120
120
121
121
<h4>🔌 Step 1: Setup the Remote App</h4>
122
122
<p>The <code>remote-app</code> exposes a <code>FruitsTable</code> component.</p>
123
+
<p>
124
+
The below code snippet configures the Webpack Module Federation Plugin for the <code>remote-app</code>. It specifies:
125
+
<ul>
126
+
<li><strong>name</strong>: The unique name of the remote application (<code>remoteApp</code>).</li>
127
+
<li><strong>filename</strong>: The name of the file (<code>remoteEntry.js</code>) that will act as the entry point for exposing modules.</li>
128
+
<li><strong>exposes</strong>: Declares the modules/components to be exposed by the remote app. Here, the <code>FruitsTable</code> component is exposed.</li>
129
+
<li><strong>shared</strong>: Specifies shared dependencies like <code>react</code> and <code>react-dom</code>, ensuring they are loaded as singletons to avoid duplication.</li>
The above code snippet configures the Webpack Module Federation Plugin for the host application. It specifies:
190
+
<ul>
191
+
<li><strong>name</strong>: The unique name of the host application (<code>hostApp</code>).</li>
192
+
<li><strong>remotes</strong>: Declares the remote application (<code>remoteApp</code>) and its entry point (<code>http://localhost:3001/remoteEntry.js</code>).</li>
193
+
<li><strong>shared</strong>: Ensures that dependencies like <code>react</code> and <code>react-dom</code> are loaded as singletons to avoid duplication across the host and remote apps.</li>
194
+
</ul>
195
+
</p>
179
196
180
-
<h5>host-app/webpack.config.js</h5>
197
+
<h5>📜 host-app/webpack.config.js</h5>
181
198
182
199
<CodeSnippetNumber="4"Language="js"Description="Module Federation Plugin setup in webpack config">
0 commit comments