File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -54,19 +54,21 @@ export default function RemoteExtensionProvider({
5454 // }, []);
5555
5656 useEffect ( ( ) => {
57- const pattern = / _ _ f e d e r a t i o n _ e x p o s e _ m a i n \. g l o b a l s \. c s s / ;
57+ // Modify the href to point to an empty CSS file
58+ // to prevent federation module's css from loading
59+ // into the main app.
60+ //
61+ // This is a workaround for the issue where
62+ // the CSS from the federated module is loaded
63+ // into the main app and overrides the main app's CSS.
64+
65+ // TODO: Use mf-manifest.json to get the css file name
66+ const pattern = / \. c s s / ;
5867 const observer = new MutationObserver ( ( mutations ) => {
5968 mutations . forEach ( ( mutation ) => {
6069 mutation . addedNodes . forEach ( ( node ) => {
6170 if ( node instanceof HTMLLinkElement && pattern . test ( node . href ) ) {
6271 console . warn ( "Removing federated CSS before it loads:" , node . href ) ;
63- // Modify the href to point to an empty CSS file
64- // to prevent federation module's css from loading
65- // into the main app.
66- //
67- // This is a workaround for the issue where
68- // the CSS from the federated module is loaded
69- // into the main app and overrides the main app's CSS.
7072 node . href = "/empty.css" ;
7173 }
7274 } ) ;
You can’t perform that action at this time.
0 commit comments