[Feature]: Support `handleHotUpdate` hook similar to Vite
What problem does this feature solve?
Similar to Vite, Rsbuild could have easy HMR handling through some specific option. Maybe this is better implemented at lower level like Rspack and it’s exposed as option in Rsbuild.
This could also solve HMR implementation details in Unplugin scenarios such as Vue plugin HMR.
What does the proposed API look like?
Take a look at handleHotUpdate API for Vite. There are a few simple concepts that I think can be implemented in Rsbuild.
Thanks, we will investigate this feature after releasing 1.0
Rsbuild and Vite have different hot update processes, so it is difficult to support this feature within rsbuild (rspack).
The current research result is that HotModuleReplacementPlugin may need to provide some hooks to support modifying the hot-update module, thus affecting the final generation of hot-update chunk and json. However, this process has not been initially validated due to manpower issues.