{"id":19380839,"url":"https://github.com/module-federation/rollup-federation","last_synced_at":"2025-04-23T20:31:46.508Z","repository":{"id":47831860,"uuid":"275039398","full_name":"module-federation/rollup-federation","owner":"module-federation","description":"Module Federation within the rollup bundler ","archived":false,"fork":false,"pushed_at":"2021-08-12T16:01:07.000Z","size":250,"stargazers_count":81,"open_issues_count":12,"forks_count":4,"subscribers_count":3,"default_branch":"release","last_synced_at":"2025-04-13T03:23:54.622Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["ScriptedAlchemy","maraisr"]}},"created_at":"2020-06-26T00:06:04.000Z","updated_at":"2024-05-29T17:29:19.000Z","dependencies_parsed_at":"2022-09-13T15:01:55.115Z","dependency_job_id":null,"html_url":"https://github.com/module-federation/rollup-federation","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/module-federation%2Frollup-federation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/module-federation%2Frollup-federation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/module-federation%2Frollup-federation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/module-federation%2Frollup-federation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/module-federation","download_url":"https://codeload.github.com/module-federation/rollup-federation/tar.gz/refs/heads/release","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250141584,"owners_count":21381624,"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":[],"created_at":"2024-11-10T09:14:58.736Z","updated_at":"2025-04-23T20:31:46.478Z","avatar_url":"https://github.com/module-federation.png","language":"JavaScript","funding_links":["https://github.com/sponsors/ScriptedAlchemy","https://github.com/sponsors/maraisr"],"categories":[],"sub_categories":[],"readme":"# rollup-federation\n\n🍣 A Rollup plugin which enables consumption of\n[Federated Modules](https://webpack.js.org/concepts/module-federation/).\n\nThis plugin essentially reproduces the functionality of Webpack's\n[ContainerReferencePlugin](https://webpack.js.org/concepts/module-federation/#containerreferenceplugin-low-level)\nand\n[OverridablesPlugin](https://webpack.js.org/concepts/module-federation/#overridablesplugin-low-level).\n\n## Limitations\n\nThis is **not** full support for Module Federation, there are limitations:\n\n-   Can not act as a container.\n    -   This means you can not federate modules from Rollup to Webpack\n-   Both the Rollup and Webpack container builds need to have the same target\n    -   Has only been tested with\n        [SystemJS](https://github.com/systemjs/systemjs)\n    -   Should theoretically work with\n        [AMD](https://requirejs.org/docs/whyamd.html#amd) as well, give it a try\n        and provide feedback.\n\n## Requirements\n\nThis plugin requires an [LTS](https://github.com/nodejs/Release) Node version\n(v8.0.0+) and Rollup v1.20.0+.\n\n## Install\n\nUsing npm:\n\n```console\nnpm install @module-federation/rollup-federation --save-dev\n```\n\n## Usage\n\nCreate a `rollup.config.js`\n[configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and\nimport the plugin:\n\n```js\nimport federation from '@module-federation/rollup-federation';\n\nexport default {\n\tinput: 'src/index.js',\n\toutput: {\n\t\tdir: 'output',\n\t\tformat: 'system',\n\t},\n\tplugins: [\n\t\tfederation({\n\t\t\tremotes: {\n\t\t\t\tfoo: 'remote_foo',\n\t\t\t},\n\t\t\tshared: {\n\t\t\t\tlodash: '^4.17.0',\n\t\t\t},\n\t\t}),\n\t],\n};\n```\n\nImport your remote:\n\n```js\n(async () =\u003e {\n\tconst fooHello = await import('foo/hello');\n\tfooHello.default('world');\n})();\n```\n\nThen call `rollup` either via the\n[CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the\n[API](https://www.rollupjs.org/guide/en/#javascript-api).\n\n## Options\n\n### `remotes`\n\nType: `Object`\u003cbr\u003e Default: `null`\n\nAn `Object` that specifies the remotes that will be consumed.\n\n```\nremotes: {\n  'import_name': 'import_alias'\n}\n```\n\n### `shared`\n\nType: `Object`\u003cbr\u003e Default: `null`\n\nAn `Object` that specifies the shared dependencies.\n\n```\nshared: {\n  lodash: '^4.17.0',\n  react: {\n    eager: true,\n    singleton: true,\n    requiredVersion: '16.13.1',\n  },\n  \"react-dom\": {\n    eager: true,\n    singleton: true,\n    requiredVersion: '16.13.1',\n  }\n}\n```\n\n\u003cimg src=\"https://ssl.google-analytics.com/collect?v=1\u0026t=event\u0026ec=email\u0026ea=open\u0026t=event\u0026tid=UA-120967034-1\u0026z=1589682154\u0026cid=ae045149-9d17-0367-bbb0-11c41d92b411\u0026dt=RollupFederation\u0026dp=/email/RollupFederation\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodule-federation%2Frollup-federation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmodule-federation%2Frollup-federation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodule-federation%2Frollup-federation/lists"}