Closed
Description
We are using webpack 5 and a design system that hosts federated modules from material ui. As of now we have the following setup for the ModuleFederationPlugin.
new ModuleFederationPlugin({
name: 'rosters-web-app',
// TODO: Make optional depending if the DS is running locally
remotes: {
'dataeng-ds': federationUrl
},
shared: {
...pkgJson.dependencies,
"@material-ui/core": {
singleton: true,
},
react: {
singleton: true,
requiredVersion: pkgJson.dependencies.react
},
"react-dom": {
singleton: true,
requiredVersion: pkgJson.dependencies["react-dom"]
}
},
})
This is how a page on the app displays:
However, when we use a component from material-ui/lab or material-ui/pickers it seems the styles get messed up.
Notice the buttons are now unstyled/overwritten
Does anyone have an idea on why this is happening?
Note: I have also tried adding
"@material-ui/lab": {
singleton: true,
},
to the shared list and it still does not work.