Skip to content

Commit 5d6b80e

Browse files
committed
fix: move invalidate into accept callback
1 parent 4fb8155 commit 5d6b80e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/plugin-react/src/fast-refresh.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,13 @@ function isReactRefreshBoundary(mod) {
100100
return hasExports && areAllExportsComponents;
101101
}
102102
103-
import(/* @vite-ignore */ import.meta.url).then(mod => {
104-
import.meta.hot.accept();
103+
import.meta.hot.accept(mod => {
105104
if (isReactRefreshBoundary(mod)) {
106105
${timeout}
107106
} else {
108107
import.meta.hot.invalidate();
109108
}
110-
})
109+
});
111110
`
112111

113112
export function addRefreshWrapper(

0 commit comments

Comments
 (0)