rstackjs / rstackjs/rspack-plugin-react-refresh
`sockIntegration: 'whm'` may inject `webpack-hot-middleware/client` twice
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 20
- Forks
- 13
- Avg merge
- 2h 55m
- Merged PRs (30d)
- 6
Description
If end-user provide webpack-hot-middleware/client explicitly in the entry. this plugin should skip to inject it.
Scenario
// `rspack.config.js`
export default {
// ...
entry: {
application: [
'./src/app.js'
'webpack-hot-middleware/client?overlay=false&quiet=true',
]
},
// ...
}
In this case, the output bundle be like below
// ...
function(__webpack_require__) {
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) }
__webpack_require__.O(0, ["common",], function() {
return __webpack_exec__("./node_modules/@rspack/plugin-react-refresh/client/reactRefreshEntry.js"),
__webpack_exec__("./node_modules/webpack-hot-middleware/client.js"),
// ^ Injected by this plugin
__webpack_exec__("./node_modules/@rspack/plugin-react-refresh/client/errorOverlayEntry.js"),
__webpack_exec__("./src/app.js"),
__webpack_exec__("./node_modules/webpack-hot-middleware/client.js?overlay=false&quiet=true");
// ^ Provided by the config
});
var __webpack_exports__ = __webpack_require__.O();
}
// ...
Prior art
https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/main/lib/index.js#L82-L98
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the sockIntegration: 'whm' handling and compare it with the prior-art implementation linked in the issue. Reproduce the rspack.config.js scenario with an explicit webpack-hot-middleware/client entry, then verify that the generated bundle contains only one client entry.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100