module-federation / module-federation-examples

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

[Question] styles.scss not reflecting in remote app when injected in shell #4283

Closed dassum03-BH closed 1 month ago

dassum03-BH commented 1 month ago

Using angular v17, currently all the styles/media queries in my styles.scss are not reflected in the mfe when injected in shell application.. I read it is a limitation.. is there any workaround?

Reference: https://github.com/nrwl/nx/issues/17945

@ScriptedAlchemy please guide/assist

ScriptedAlchemy commented 1 month ago

Does a federated module you exposed import the stylesheet? You must explicitly import the styles. In an exposed module, if it's just something that is implicitly inherited from higher up in the app, then the exposed module doesn't know that there's any dependency on that file. Therefore, you should import it in the file to ensure that it will be loaded with the exposed module.