You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to listen for changes in a file using "import.meta.webpackHot.accept" and react to the changes.
However, when changing in the class code, nothing happens, as if the file does not change.
note "a": there is a workaround to make the system react to changes. for this it is enough to export an empty function next to the class. now I have to place such a hack in each file with a class.
note "b": I tried to reproduce the problem with rspack and it doesn't seem to reproduce the problem.
Version
Details
I want to listen for changes in a file using "import.meta.webpackHot.accept" and react to the changes.
However, when changing in the class code, nothing happens, as if the file does not change.
note "a": there is a workaround to make the system react to changes. for this it is enough to export an empty function next to the class. now I have to place such a hack in each file with a class.
note "b": I tried to reproduce the problem with
rspack
and it doesn't seem to reproduce the problem.Reproduce link
https://github.com/dartess/rsbuild-class-hmr
Reproduce Steps
npm i
npm run dev:rsbuild
value
insrc/Features.ts
expected result:
console.log
:changed!
actual result: nothing.
for note "a": uncomment
// export function hmrHack() {}
and try again — everything works fine with this workaround.The text was updated successfully, but these errors were encountered: