{"id":18532686,"url":"https://github.com/itwillwork/template-module-federation-webpack-plugin","last_synced_at":"2025-07-30T05:06:36.835Z","repository":{"id":157586859,"uuid":"633362772","full_name":"itwillwork/template-module-federation-webpack-plugin","owner":"itwillwork","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-28T08:22:17.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-04T08:59:56.230Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itwillwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-27T10:37:44.000Z","updated_at":"2023-04-27T18:27:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"aa884715-49a0-49b6-b50f-e9aabf2a3b61","html_url":"https://github.com/itwillwork/template-module-federation-webpack-plugin","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"2de4f43a97739a5a725b7d456a8534eef898acf8"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itwillwork%2Ftemplate-module-federation-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itwillwork%2Ftemplate-module-federation-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itwillwork%2Ftemplate-module-federation-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itwillwork%2Ftemplate-module-federation-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itwillwork","download_url":"https://codeload.github.com/itwillwork/template-module-federation-webpack-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itwillwork%2Ftemplate-module-federation-webpack-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258652617,"owners_count":22736154,"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-06T19:07:31.248Z","updated_at":"2025-06-15T02:32:42.582Z","avatar_url":"https://github.com/itwillwork.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# template-module-federation-webpack-plugin\n\n`html-webpack-plugin` for module federation\n\n## Installation\n\n```\nnpm i --save-dev template-module-federation-webpack-plugin\n```\n\n## Usage\n\nCreate template, for example `src/templates/widget.ejs`:\n```ejs\nconsole.info('Version: \u003c%= VERSION %\u003e');\nwindow.CONFIG = '{{ clientConfig }}';\n```\n\nAdd webpack plugin to config:\n```js\nimport { TemplateModuleFederationPlugin } from 'template-module-federation-webpack-plugin';\n\n// ...\n\nplugins: [\n    // ...\n    new ModuleFederationPlugin({\n        // ...\n        filename: 'widget.js',\n        // ...\n    }),\n    // ...\n    new TemplateModuleFederationPlugin({\n      templateParameters: {\n        VERSION: 'v1.2',\n      },\n      paths: [\n        {\n          template: 'src/templates/widget.ejs',\n          output: 'widget-entry.js',\n          inlineFilenames: ['widget.js'],\n        },\n      ],\n    }),\n    //...\n]\n```\n\n## Options\n\n| Option  | Type | Description |\n| ------------- | ------------- | ------------- |\n| templateParameters | object | The object that is passed to the template engine. In the template, for example `templateParameters: { foo: 'bar' }`, you can use `\u003c%= foo %\u003e` (without formatting `\u003c%- foo %\u003e`) |\n| paths[number].template | string | Path to the template  |\n| paths[number].output | string | Path to the output file |\n| paths[number].inlineFilenames | Array\u003cstring\u003e     | Inline file names |\n\n## Advanced Usage\n\n##### Add inline scripts\n\nFor example, add inline script `analytics.js` (entry) to template `src/templates/widget.ejs`:\n```ejs\n// ...\n\u003c%- compilation.assets[\"analytics.js\"].source() %\u003e\n// ...\n```\n\n##### Move inline scripts\n\nFor example, move inline scripts into template `src/templates/widget.ejs`:\n```ejs\nconsole.log(\"start\");\n// ...\n\u003c%- inlineFilesContent %\u003e\n// ...\nconsole.log(\"end\");\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitwillwork%2Ftemplate-module-federation-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitwillwork%2Ftemplate-module-federation-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitwillwork%2Ftemplate-module-federation-webpack-plugin/lists"}