{"id":17351354,"url":"https://github.com/zhanghongen/inject-webpack","last_synced_at":"2025-10-06T17:07:16.422Z","repository":{"id":83582929,"uuid":"573058112","full_name":"zhangHongEn/inject-webpack","owner":"zhangHongEn","description":"Inject code, support webpack-4、5 and module-federation","archived":false,"fork":false,"pushed_at":"2023-07-04T06:59:56.000Z","size":7,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T21:14:08.263Z","etag":null,"topics":["code","inject","inject-webpack","module-federation","webpack","webpack-plugin","webpack4","webpack5"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/zhangHongEn.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":"2022-12-01T15:55:44.000Z","updated_at":"2023-11-20T10:17:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"0b709327-3f51-4f78-adc9-f44784a76afc","html_url":"https://github.com/zhangHongEn/inject-webpack","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/zhangHongEn%2Finject-webpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangHongEn%2Finject-webpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangHongEn%2Finject-webpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhangHongEn%2Finject-webpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhangHongEn","download_url":"https://codeload.github.com/zhangHongEn/inject-webpack/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248961237,"owners_count":21189993,"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":["code","inject","inject-webpack","module-federation","webpack","webpack-plugin","webpack4","webpack5"],"created_at":"2024-10-15T17:09:37.833Z","updated_at":"2025-10-06T17:07:11.396Z","avatar_url":"https://github.com/zhangHongEn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# inject-webpack\n\n[![npm](https://img.shields.io/npm/v/inject-webpack.svg)](https://www.npmjs.com/package/inject-webpack)\n\nwebpack inject plugin\n\n### API\n\n``` js\n// webpack.config.js\nconst Inject = require(\"inject-webpack\")\n\nmodule.exports = {\n    entry: {\n        a,\n        b\n    },\n    plugins: [\n        new ModuleFederation({\n          filename: \"remoteEntry.js\",\n          exposes: {\n            \"App\": \"src/App\",\n            \"Button\": \"src/Button\"\n          },\n        }),\n        new Inject(() =\u003e {\n            return `console.log(\"inject code1\")`\n        }, {\n            // entry: a、b、webpack-dev-server.....\n            // remoteEntry: remoteEntry.js\n            // exposesEntry: src/App、src/Button\n            // default value is [\"entry\", \"remoteEntry\"]\n            scopes: [\"entry\", \"remoteEntry\", \"exposesEntry\"],\n            // In addition to the entry files corresponding to scopes, code is also injected into these files\n            extraInjection: [/src\\/a\\//]\n        }),\n    ]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhanghongen%2Finject-webpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhanghongen%2Finject-webpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhanghongen%2Finject-webpack/lists"}