Created by: hasanayan
I re-enabled @raix's code to enable module-federation and added the necessary changes to the webpack config. Tested the changes by making the same modifications using craco in apps that both run as standalone or remote apps and it works fine.
With this PR, to enable Module Federation, you'll need a file named .modulefederationrc.js which exports ModuleFederationPlugin parameters as json.
const deps = require("./package.json").dependencies;
module.exports = {
name: "my_app",
exposes: {
"./App": "./src/App",
},
filename: "remoteEntry.js",
shared: {
///...
}
}
in addition to that, including a mmodule federation file and setting EXTERNAL_TEMPLATE_REMOTES env var to 'true' includes ExternalTemplateRemotesPlugin into the config.
(if you want to help out on that, then checkout this branch - when checking of the cra project run yarn then create a provider and consumer app using yarn create-react-app and read the MF docs using docusaurus/docs yarn start :)