{"id":19380848,"url":"https://github.com/module-federation/external-remotes-plugin","last_synced_at":"2025-04-23T20:31:46.545Z","repository":{"id":48426100,"uuid":"369013518","full_name":"module-federation/external-remotes-plugin","owner":"module-federation","description":"Dynamically set remote origins at runtime within hosts","archived":false,"fork":false,"pushed_at":"2021-07-27T00:48:37.000Z","size":8,"stargazers_count":53,"open_issues_count":7,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-21T21:24:51.067Z","etag":null,"topics":["federation","module","module-federation","module-federation-examples","webpack","webpack-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/module-federation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-19T22:10:59.000Z","updated_at":"2024-12-13T01:50:33.000Z","dependencies_parsed_at":"2022-08-31T18:33:53.335Z","dependency_job_id":null,"html_url":"https://github.com/module-federation/external-remotes-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/module-federation%2Fexternal-remotes-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/module-federation%2Fexternal-remotes-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/module-federation%2Fexternal-remotes-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/module-federation%2Fexternal-remotes-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/module-federation","download_url":"https://codeload.github.com/module-federation/external-remotes-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250509653,"owners_count":21442469,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["federation","module","module-federation","module-federation-examples","webpack","webpack-plugin"],"created_at":"2024-11-10T09:14:59.242Z","updated_at":"2025-04-23T20:31:46.470Z","avatar_url":"https://github.com/module-federation.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# external-remotes-plugin\n\n**Host webpack.config**\n```js\nconst config = {\n   ...otherConfigs\n  plugins: [\n    new ModuleFederationPlugin({\n      name: \"app1\",\n      remotes: {\n        app2: \"app2@[window.app2Url]/remoteEntry.js\"\n      }\n    }).\n    new ExternalTemplateRemotesPlugin(),\n  ]\n}\n```\n\nor\n\n```js\nplugins: [\n    new ModuleFederationPlugin({\n        name: 'my-app',\n        remotes: {\n            'my-remote-1': 'my-remote-1@[window.remote-1-domain]/remoteEntry.js?[getRandomString()]',\n            ...\n        },\n        shared: {...}\n    }),\n    new ExternalTemplateRemotesPlugin(), //no parameter,\n]\n```\n\n**Host (app1) source somewhere before loading main entry file**\n```js\nwindow.app2Url = \"//localhost:3002\"; // Whatever the url/logic to determine your remote module is\n\nimport(\"./bootstrap\");\n```\n\nWorking example is also available in this PR: https://github.com/module-federation/module-federation-examples/pull/557.\n\n**Update:** the PR was merged a example can be found under [advanced-api/dynamic-remotes-synchronous-imports](https://github.com/module-federation/module-federation-examples/tree/d5cf265c2d4fd040797cbae806badd8267ad5b8f/advanced-api/dynamic-remotes-synchronous-imports)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodule-federation%2Fexternal-remotes-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmodule-federation%2Fexternal-remotes-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodule-federation%2Fexternal-remotes-plugin/lists"}