mirror of https://github.com/vuejs/core.git
Revert "fix(hmr): prevent __VUE_HMR_RUNTIME__ from being overwritten by vue runtime in 3rd-party libraries" (#13925)
This reverts commit 1392734ae5
.
This commit is contained in:
parent
8bb8fb2362
commit
6b68f72673
|
@ -31,17 +31,11 @@ export interface HMRRuntime {
|
||||||
// Note: for a component to be eligible for HMR it also needs the __hmrId option
|
// Note: for a component to be eligible for HMR it also needs the __hmrId option
|
||||||
// to be set so that its instances can be registered / removed.
|
// to be set so that its instances can be registered / removed.
|
||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
const g = getGlobalThis()
|
getGlobalThis().__VUE_HMR_RUNTIME__ = {
|
||||||
// vite-plugin-vue/issues/644, #13202
|
createRecord: tryWrap(createRecord),
|
||||||
// custom-element libraries bundle Vue to simplify usage outside Vue projects but
|
rerender: tryWrap(rerender),
|
||||||
// it overwrite __VUE_HMR_RUNTIME__, causing HMR to break.
|
reload: tryWrap(reload),
|
||||||
if (!g.__VUE_HMR_RUNTIME__) {
|
} as HMRRuntime
|
||||||
g.__VUE_HMR_RUNTIME__ = {
|
|
||||||
createRecord: tryWrap(createRecord),
|
|
||||||
rerender: tryWrap(rerender),
|
|
||||||
reload: tryWrap(reload),
|
|
||||||
} as HMRRuntime
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const map: Map<
|
const map: Map<
|
||||||
|
|
Loading…
Reference in New Issue