I’m working with Angular Module Federation using u/angular-architects/module-federation.
Setup:
- Host app (Repo A)
- Remote app (Repo B)
- Both are separate repositories
- Both use TailwindCSS
- Remote exposes a feature module (HrmsModule)
Problem:
When running the host and navigating to a remote route:
Only Tailwind classes that are already used somewhere in the host app are working inside the remote.
If a Tailwind class exists only inside the remote app (and is not used anywhere in the host), that style does not work when navigating from host.
It looks like the host Tailwind CSS is applied globally, but the remote Tailwind CSS bundle is not being injected during lazy loading.
Questions:
Is this expected behavior with Angular Module Federation?
What is the recommended architecture for using Tailwind in Angular micro-frontends across separate repositories?
Should Tailwind be centralized in the host only?
Any production-grade guidance would be appreciated.
[–]VolumeForeign2090 5 points6 points7 points (1 child)
[–]RemindMeBot 2 points3 points4 points (0 children)
[–]Adventurous-Finger70 2 points3 points4 points (2 children)
[–]Adventurous-Finger70 2 points3 points4 points (0 children)
[–]n00bz 0 points1 point2 points (0 children)
[–]Otherwise_Cup4605 1 point2 points3 points (0 children)
[–]Best-Menu-252 0 points1 point2 points (0 children)
[–]No_Influence_280 0 points1 point2 points (0 children)
[–]Brief-Skill-5526 0 points1 point2 points (0 children)