{"id":17531375,"url":"https://github.com/artembatura/hot-accept-webpack-plugin","last_synced_at":"2025-04-23T20:23:02.120Z","repository":{"id":49148819,"uuid":"169330395","full_name":"artembatura/hot-accept-webpack-plugin","owner":"artembatura","description":"Adds `module.hot.accept` to your modules","archived":false,"fork":false,"pushed_at":"2023-02-12T16:55:24.000Z","size":60504,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T19:06:17.916Z","etag":null,"topics":["hot-reload","module","replacement","webpack","webpack-plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/artembatura.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-05T23:40:34.000Z","updated_at":"2025-03-01T00:15:53.000Z","dependencies_parsed_at":"2024-06-18T21:27:18.240Z","dependency_job_id":null,"html_url":"https://github.com/artembatura/hot-accept-webpack-plugin","commit_stats":{"total_commits":41,"total_committers":6,"mean_commits":6.833333333333333,"dds":0.5853658536585367,"last_synced_commit":"41d16d177ad23aa46dc78add77897f9411378fa7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artembatura%2Fhot-accept-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artembatura%2Fhot-accept-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artembatura%2Fhot-accept-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artembatura%2Fhot-accept-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artembatura","download_url":"https://codeload.github.com/artembatura/hot-accept-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250506768,"owners_count":21441841,"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":["hot-reload","module","replacement","webpack","webpack-plugin"],"created_at":"2024-10-20T17:23:46.273Z","updated_at":"2025-04-23T20:23:02.087Z","avatar_url":"https://github.com/artembatura.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://img.shields.io/npm/v/hot-accept-webpack-plugin.svg)](https://www.npmjs.com/package/hot-accept-webpack-plugin)\n![npm version](https://img.shields.io/npm/dm/hot-accept-webpack-plugin.svg)\n![npm version](https://img.shields.io/npm/dt/hot-accept-webpack-plugin.svg)\n![npm version](https://img.shields.io/snyk/vulnerabilities/npm/hot-accept-webpack-plugin.svg)\n![npm version](https://img.shields.io/librariesio/release/npm/hot-accept-webpack-plugin.svg)\n[![npm version](https://img.shields.io/npm/l/hot-accept-webpack-plugin.svg)](https://github.com/artembatura/hot-accept-webpack-plugin)\n\n# [hot-accept-webpack-plugin](https://www.npmjs.com/package/hot-accept-webpack-plugin)\n\nSimple webpack plugin to add HMR accepting code to need modules.\n\n## Compatibility\n\n| Webpack Version | Plugin version | Status                   |\n| --------------- | -------------- | ------------------------ |\n| ^5.0.0          | ^4.0.0         | \u003cp align=\"center\"\u003e✅\u003c/p\u003e |\n| ^4.37.0         | ^4.0.0         | \u003cp align=\"center\"\u003e✅\u003c/p\u003e |\n\n## Installation\n\n### NPM\n\n```\nnpm i -D hot-accept-webpack-plugin\n```\n\n### Yarn\n\n```\nyarn add -D hot-accept-webpack-plugin\n```\n\n## Import\n\n### ES6/TypeScript\n\n```js\nimport { HotAcceptPlugin } from 'hot-accept-webpack-plugin';\n```\n\n### CJS\n\n```js\nconst { HotAcceptPlugin } = require('hot-accept-webpack-plugin');\n```\n\n## Usage\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  plugins: [new HotAcceptPlugin(options)]\n};\n```\n\n## Options\n\n### `test`\n\nType: `string | RegExp | (string | RegExp)[]`\n\n`Required`\n\n#### Example (with RegExp)\n\nIn this example plugin will add `module.hot.accept` to all modules with filename `index.js`.\n\n**webpack.config.js**\n\n```js\nconst { HotModuleReplacementPlugin } = require('webpack');\nconst { HotAcceptPlugin } = require('hot-accept-webpack-plugin');\n\nmodule.exports = {\n  plugins: [\n    new HotModuleReplacementPlugin(),\n    new HotAcceptPlugin({\n      test: /index\\.js$/\n    })\n  ]\n};\n```\n\nIf you want to add `module.hot.accept` only to one specific file, you need declare more precise path to file. You can check next example.\n\n#### Example (specific file)\n\nFor example, we have the following file structure\n\n```\nsrc/index.js\nsrc/components/TodoList.js\nsrc/components/index.js\n```\n\nIf we want to add `module.hot.accept` only to `src/index.js`, we should use following RegExp: `/src\\/index\\.js$/`.\n\n**webpack.config.js**\n\n```js\nconst { HotModuleReplacementPlugin } = require('webpack');\nconst { HotAcceptPlugin } = require('hot-accept-webpack-plugin');\n\nmodule.exports = {\n  plugins: [\n    new HotModuleReplacementPlugin(),\n    new HotAcceptPlugin({\n      test: /src\\/index\\.js$/\n    })\n  ]\n};\n```\n\n#### Example (with string)\n\n**webpack.config.js**\n\n```js\nconst { HotModuleReplacementPlugin } = require('webpack');\nconst { HotAcceptPlugin } = require('hot-accept-webpack-plugin');\n\nmodule.exports = {\n  plugins: [\n    new HotModuleReplacementPlugin(),\n    new HotAcceptPlugin({\n      test: 'index.js'\n    })\n  ]\n};\n```\n\n#### Example (with test as array)\n\n**webpack.config.js**\n\n```js\nconst { HotModuleReplacementPlugin } = require('webpack');\nconst { HotAcceptPlugin } = require('hot-accept-webpack-plugin');\nmodule.exports = {\n  plugins: [\n    new HotModuleReplacementPlugin(),\n    new HotAcceptPlugin({\n      test: ['one-module.js', /two-module.js$/]\n    })\n  ]\n};\n```\n\nThis plugin is based on [modify-source-webpack-plugin](https://github.com/artembatura/modify-source-webpack-plugin).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartembatura%2Fhot-accept-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartembatura%2Fhot-accept-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartembatura%2Fhot-accept-webpack-plugin/lists"}