Skip to content

Commit bea196d

Browse files
committed
refactor: HMR
1 parent c4e0bbe commit bea196d

File tree

1 file changed

+1
-5
lines changed
  • packages/vue-jsx-vapor/src/core

1 file changed

+1
-5
lines changed

packages/vue-jsx-vapor/src/core/hmr.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,7 @@ export function injectHMRAndSSR(
111111
`\n${local}.__hmrId = "${id}";` +
112112
`\n__VUE_HMR_RUNTIME__.createRecord("${id}", ${local});`
113113
callbackCode += `
114-
if (typeof mod['${exported}'] === 'function') {
115-
__VUE_HMR_RUNTIME__.rerender(mod['${exported}'].__hmrId, mod['${exported}']);
116-
} else {
117-
__VUE_HMR_RUNTIME__.reload(mod['${exported}'].__hmrId, mod['${exported}']);
118-
};`
114+
__VUE_HMR_RUNTIME__[typeof mod['${exported}'] === 'function' ? 'rerender' : 'reload'](mod['${exported}'].__hmrId, mod['${exported}']);`
119115
}
120116

121117
code += `

0 commit comments

Comments
 (0)