{"id":16742355,"url":"https://github.com/alexispuga/hook-webpack-plugin","last_synced_at":"2026-05-13T07:40:47.015Z","repository":{"id":50940671,"uuid":"213108020","full_name":"AlexisPuga/hook-webpack-plugin","owner":"AlexisPuga","description":"Create, intercept and/or extend the functionality of any plugin by using hooks from your config file.","archived":false,"fork":false,"pushed_at":"2023-03-15T01:17:26.000Z","size":451,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-23T00:05:06.074Z","etag":null,"topics":["circle-ci","coveralls","eslint","github-wiki","jsdoc-comments","npm-package","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/AlexisPuga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-06T04:21:07.000Z","updated_at":"2022-04-20T21:18:30.000Z","dependencies_parsed_at":"2023-02-09T13:31:09.188Z","dependency_job_id":null,"html_url":"https://github.com/AlexisPuga/hook-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexisPuga%2Fhook-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexisPuga%2Fhook-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexisPuga%2Fhook-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexisPuga%2Fhook-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexisPuga","download_url":"https://codeload.github.com/AlexisPuga/hook-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243809530,"owners_count":20351383,"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":["circle-ci","coveralls","eslint","github-wiki","jsdoc-comments","npm-package","webpack-plugin"],"created_at":"2024-10-13T01:23:31.328Z","updated_at":"2026-05-13T07:40:46.967Z","avatar_url":"https://github.com/AlexisPuga.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp\u003e\n    \u003ca href='https://coveralls.io/github/AlexisPuga/hook-webpack-plugin?branch=master' target='_blank'\u003e\u003cimg src='https://coveralls.io/repos/github/AlexisPuga/hook-webpack-plugin/badge.svg?branch=master' alt='Coverage Status'/\u003e\u003c/a\u003e\n    \u003ca href='https://circleci.com/gh/AlexisPuga/hook-webpack-plugin' target='_blank'\u003e\u003cimg align='right' src='https://circleci.com/gh/AlexisPuga/hook-webpack-plugin.svg?style=svg' alt='CircleCI'/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr/\u003e\n\n## Hook - webpack plugin\n\n**Create** custom plugins from your config file and avoid loosing time finding or maintaining a simple plugin.\n\n**Intercept** any plugin and customize it to match your preferences.\n\n**Group** your hooks to create a new plugin and modify it when you want.\n\n## Contents\n- [Installation](#installation)\n- [Usage](#usage)\n- [Examples](#examples)\n    - [Creating a plugin](#creating-a-plugin)\n    - [Registering a plugin](#registering-a-plugin)\n    - [Intercepting another plugin](#intercepting-another-plugin)\n- [More info](#more-info)\n- [License](#license)\n\n## Installation\n\n\u003ca href='https://npmjs.org/package/hook-webpack-plugin'\u003e\u003cimg align='right' src='https://nodei.co/npm/hook-webpack-plugin.png?compact=true' alt='NPM'/\u003e\u003c/a\u003e\n\n**Via npm:**\n```\nnpm i hook-webpack-plugin\n```\n\n**Via yarn:**\n```\nyarn add hook-webpack-plugin --dev\n```\n\n## Usage\n\nAdd something like the following to your config file, in the plugin section:\n\n```js\n// webpack.config.js\nconst HookWebpackPlugin = require('hook-webpack-plugin');\n\n// ...\nplugins: [\n    // ...\n    new HookWebpackPlugin(hookName, hookFn, options)\n    // ...\n]\n// ...\n\n```\nThen, replace the following values:\n\n\u003cdl\u003e\n    \u003cdt\u003e\u003cvar\u003ehookName\u003c/var\u003e: string\u003c/dt\u003e\n    \u003cdd\u003eThe name of a \u003ca href='https://webpack.js.org/api/compiler-hooks/' target='_blank'/\u003ecompiler\u003c/a\u003e/\u003ca href='https://webpack.js.org/api/compilation-hooks/' target='_blank'\u003ecompilation\u003c/a\u003e hook. \u003ci\u003eSomething like \"emit\", \"done\", ...\u003c/i\u003e\u003c/dd\u003e\n    \u003cdt\u003e\u003cvar\u003ehookFn\u003c/var\u003e: function\u003c/dt\u003e\n    \u003cdd\u003eThe listener for the hook.\u003c/dd\u003e\n    \u003cdt\u003e\u003cvar\u003eoptions\u003c/var\u003e: object\u003csub\u003eopt\u003c/sub\u003e\u003c/dt\u003e\n    \u003cdd\u003e\n        \u003ctable\u003e\n            \u003cthead\u003e\n                \u003ctr\u003e\n                    \u003cth\u003eProperty\u003c/th\u003e\n                    \u003cth\u003eDefault\u003c/th\u003e\n                    \u003cth\u003eDescription\u003c/th\u003e\n                \u003c/tr\u003e\n            \u003c/thead\u003e\n            \u003ctbody\u003e\n                \u003ctr\u003e\n                    \u003cth\u003esync\u003c/th\u003e\n                    \u003ctd\u003efalse [async when possible]\u003c/td\u003e\n                    \u003ctd\u003eIf a truthy value is given use `tap`, otherwise use `tapAsync`.\u003c/td\u003e\n                \u003c/tr\u003e\n                \u003ctr\u003e\n                    \u003cth\u003epluginName\u003c/th\u003e\n                    \u003ctd\u003eHookWebpackPlugin\u003c/td\u003e\n                    \u003ctd\u003eValue to use in tap/tapAsync methods.\u003c/td\u003e\n                \u003c/tr\u003e\n            \u003c/tbody\u003e\n        \u003c/table\u003e\n    \u003c/dd\u003e\n\u003c/dl\u003e\n\n## Examples\n\n### Creating a plugin\n\n```js\n// webpack.config.js\n\nplugins: [\n    new HookWebpackPlugin(hookName, compilerHook (...args) {\n        // Do something awesome...\n    })\n]\n\n```\n\n### Registering a plugin\n\n*Name your plugin and group multiple hooks together, internally.*\n\n```js\n// webpack.config.js\n\nplugins: [\n    new HookWebpackPlugin(hookName, compilerHook, {pluginName: 'MyAwesomePlugin'}),\n    new HookWebpackPlugin(anotherHookName, anotherCompilerHook, {pluginName: 'MyAwesomePlugin'})\n]\n\n```\n\n### Intercepting another plugin\n\n*Set the `pluginName` option to the internal name of the plugin you want to intercept.*\n\n```js\n// webpack.config.js\n\nplugins: [\n    new ThirdPartyPlugin(options),\n    new HookWebpackPlugin(hookName, () =\u003e {\n        // Your code...\n    }, {'pluginName': 'ThirdPartyPlugin'})\n]\n\n```\n\n## More info\n\nCheck the [docs](https://github.com/AlexisPuga/hook-webpack-plugin/wiki) for more details.\n\n## License\nhook-webpack-plugin is [MIT licensed](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexispuga%2Fhook-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexispuga%2Fhook-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexispuga%2Fhook-webpack-plugin/lists"}