feat: add MF Rspack standalone examples for basehref #100
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's added in this PR?
This PR provides a example for basehref usage with Module Federation + Rspack + Zephyr.
The ones with examples are way ahead on testing.
There is another example using Rspack, but with no MF:
What's the issues or discussion related to this PR ?
The Rspack allows bashref as a custom path using the publicPath parameter in the plugin config. Works fine along Zephyr. Adding Module Federation to the formula forces to use "auto" parameter in the publicPath default in order to resolve dinamically remote built urls for the host. If the basehref parameter is added to the Rspack config, MF changes the URL handling to absolute or relative instead auto resolving.
That is the main issue we have found: if bashref is added to the remote, then the host needs the remote declaration as an absolute path, for each remote; or if is passed relative, then will not load the remote because relative evaluate on its own domain, instead remote domains.
Model Host - 2 Remotes - using "auto" URL evaluation
Model Host - 2 Remotes - absolute path pointing
Model Host - 2 Remotes - relative path pointing
What are the steps to test this PR?
Implement an example for basehref usage with MF + Rspack + Zephyr
Documentation update for this PR (if applicable)?
(Optional) What's left to be done for this PR?
The Basehref + MF + Rspack with Zephyr implementation was moved to backlog until further implementation for dynamic domain handling.
It is supposed to have some MF implementation to handle the dynamic remote URLs on Zephyr build
(Optional) What's the potential risk and how to mitigate it?
(Required) Pre-PR/Merge checklist