module-federation / module-federation-examples

Implementation examples of module federation , by the creators of module federation
https://module-federation.io/
MIT License
5.49k stars 1.72k forks source link

CSS Isolation for the remote app #3170

Open rk12345677 opened 10 months ago

rk12345677 commented 10 months ago

Hi @ScriptedAlchemy i have integrated a remote app with my host app using module federation both remote and host app is on react. i am using mini-css-extract-plugin for the css. The problem is i am using different version of library in both app due to that i am getting some css issue after loading the remote app in the host app apart from that everything works fine. Can someone help me isolating the css of the remote app from the host app so that it won't affect.

RussellCanfield commented 10 months ago

I would adjust the specificity of your css or turn on css modules if possible. It’s a nice safe guard for the future

raymondboswel commented 10 months ago

https://github.com/module-federation/module-federation-examples/tree/master/css-isolation