Skip to content

Commit 6b68f72

Browse files
authored
Revert "fix(hmr): prevent __VUE_HMR_RUNTIME__ from being overwritten by vue runtime in 3rd-party libraries" (#13925)
This reverts commit 1392734.
1 parent 8bb8fb2 commit 6b68f72

File tree

1 file changed

+5
-11
lines changed
  • packages/runtime-core/src

1 file changed

+5
-11
lines changed

packages/runtime-core/src/hmr.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,11 @@ export interface HMRRuntime {
3131
// Note: for a component to be eligible for HMR it also needs the __hmrId option
3232
// to be set so that its instances can be registered / removed.
3333
if (__DEV__) {
34-
const g = getGlobalThis()
35-
// vite-plugin-vue/issues/644, #13202
36-
// custom-element libraries bundle Vue to simplify usage outside Vue projects but
37-
// it overwrite __VUE_HMR_RUNTIME__, causing HMR to break.
38-
if (!g.__VUE_HMR_RUNTIME__) {
39-
g.__VUE_HMR_RUNTIME__ = {
40-
createRecord: tryWrap(createRecord),
41-
rerender: tryWrap(rerender),
42-
reload: tryWrap(reload),
43-
} as HMRRuntime
44-
}
34+
getGlobalThis().__VUE_HMR_RUNTIME__ = {
35+
createRecord: tryWrap(createRecord),
36+
rerender: tryWrap(rerender),
37+
reload: tryWrap(reload),
38+
} as HMRRuntime
4539
}
4640

4741
const map: Map<

0 commit comments

Comments
 (0)