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
{{ message }}
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
I am using react-refresh and HMR and noticed that my code reloads twice, I am using typescript seperately from webpack, and use tsc --watch in the background which compiles typescript to JS (and also generated the sourcemaps).
In another process, I have a very simple webpack config with a react refresh plugin and source-map-loader with the entry point pointing to the (typescript) compiled index.js file.
Now, I found that source-map-loader adds the source files (e.g. .tsx and .ts files) to webpack's dependencies (and thus they are watched as well).
Now, when I change a source file, webpack watch triggers, and when the typescript compiler finishes, webpack is triggered again because the compiled file is (naturally) in webpacks dependencies as well.
I wonder what can be done to improve this situation, perhaps we should add an option to this plugin to not add the source files as a dependency?
I also wonder what the actual use case of adding the sourceURL as a dependency is.