The Microfrontend
architecture differs from the traditional monolithic application development model. Its characteristics of separate development, deployment, and debugging necessitate a new set of debugging tools to meet new usage scenarios, such as: how to verify the effect of modules in actual projects when developing Module Federation
, whether the dependencies of Module Federation
are reused with the host environment, which Module Federation
modules are loaded on the current page, the dependency relationships of Module Federation
, and how the data flow between Module Federation
works.
Chrome DevTools
provides the following capabilities:
Module Federation
proxy functionality, which proxies the Module Federation
on the online page to the user's local Module Federation
.Module Federation
on the online page for rapid feature verification.You must use mf-manifest.json
to utilize the visualization and proxy capabilities provided by Chrome DevTools
.
Development and production environments:
http://localhost:3000/mf-manifest.json
, the page will directly load the Module Federation
content from port 3000.mf-manifest.json
file address format, for example, key: appA -> value: https://xxx/static/mf-manifest.json
, the page will directly load the Module Federation
content from the specified address.Add to Chrome
button.The plugin provides a DevTools panel:
Module Federation
tab to enter the proxy page, where you can proxy and debug the dependent modules.
As shown in the figure below, the proxy page provides options for operations such as add new proxy module
, producer selector
, version or local port or custom entry
.
producer selector
.mf-manifest.json
) through version or local port
to perform the proxy operation.add new proxy module
area to add the corresponding proxy modules.You can open DevTools in a separate window.
✅ Complies with validation rules.
✅ Configuration rules are checked.
✅ Configuration is filled in correctly, the page shows: Proxy configuration is effective, remote module retrieval is successful, the corresponding page has been automatically refreshed.
The plugin will filter out modules that comply with the configuration rules for proxying.