Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !11241

add module federation support

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Administrator requested to merge github/fork/hasanayan/module-federation into main Jul 23, 2021
  • Overview 13
  • Commits 29
  • Pipelines 0
  • Changes 8

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 :)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/hasanayan/module-federation