Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Commit 256c198

Browse files
committed
Minor fix 🚀
1 parent e19dd31 commit 256c198

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/posts/2022-06-06-microfrontend-module-federation-dynamic-configuration.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,9 @@ module.exports = {
308308
309309
Now, if you look closely to the configuration above you noticed something strange:
310310
311-
* the url of the remote entry file is defined as `'cancelOrderWidget@[widgets.cancellationOrderWidgetUrl]/remoteEntry.js'`, so it expecting to find it in some way defined in the `[widgets.cancellationOrderWidgetUrl]` placeholder.
311+
* the url of the remote entry file is defined as `'cancelOrderWidget@[widgets.cancellationOrderWidgetUrl]
312+
/remoteEntry.js'`, so it expects to find it in some way defined in the `[widgets.cancellationOrderWidgetUrl]`
313+
placeholder.
312314
* we are calling an additional plugin from the module federartion world called `ExternalTemplateRemotesPlugin`.
313315

314316
This combination in the configuration will let us define the url of the remote entry file dinamically at runtime when the application starts :heart_eyes:. This is a consequence of the fact that what we defined as `[widgets.cancellationOrderWidgetUrl]/remoteEntry.js'` will be replaced by the `ExternalTemplateRemotesPlugin` as `widgets.cancellationOrderWidgetUrl + "/remoteEntry.js"`, so a concatenation of a variable, `widgets.cancellationOrderWidgetUrl` that as you can see is defined on the `window` object, plus the fixed part of the url `"/remoteEntry.js"` ([here](https://github.com/module-federation/external-remotes-plugin/blob/main/index.js "ExternalTemplateRemotesPlugin") you can find the source code for the `ExternalTemplateRemotesPlugin` that contains the concatenation described here).

0 commit comments

Comments
 (0)