Skip to content

Commit

Permalink
fix(vue): handle undefined on import.meta.hot.accept (fixes #8625) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Jul 10, 2022
1 parent aff4544 commit 70af44a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/plugin-vue/src/main.ts
Expand Up @@ -128,7 +128,9 @@ export async function transformMain(
output.push(`export const _rerender_only = true`)
}
output.push(
`import.meta.hot.accept(({ default: updated, _rerender_only }) => {`,
`import.meta.hot.accept(mod => {`,
` if (!mod) return`,
` const { default: updated, _rerender_only } = mod`,
` if (_rerender_only) {`,
` __VUE_HMR_RUNTIME__.rerender(updated.__hmrId, updated.render)`,
` } else {`,
Expand Down

0 comments on commit 70af44a

Please sign in to comment.