Repository navigation
What is the recommended way to combine lazyCompilation/HMR with watching.suspend() / resume()? #15669
|
Context This works well in plain watch mode. We recently added @rspack/dev-server with HMR and lazy compilation on top of this suspend/resume flow, so users don't need a full page reload after each rebuild. Current LazyCompilation Trial we are trying to suspend the watcher again from the done hook: Problem This seems to suspend the watcher before the browser has finished processing the HMR update, which results in HMR manifest requests returning 404. Questions
The main goal is to keep the watcher suspended while our IDE is writing files, while still allowing lazy compilation and HMR to complete correctly before suspending the watcher again. |
Replies: 1 comment
|
|
doneonly confirms compilation. In the browser,import.meta.webpackHot.addStatusHandlercan observeapplyfollowed byidle. Send the runtime hash back to Node and match the target build;idlealone doesn't prove an update was applied. Treatabort/failas failures. This doesn't diagnose the 404.