Skip to content

Commit

Permalink
fix: handle undefined on import.meta.hot.accept
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red authored and sodatea committed Aug 31, 2022
1 parent 0330a3e commit b668430
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.ts
Expand Up @@ -118,7 +118,9 @@ var __component__ = /*#__PURE__*/__normalizer(
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(${id}, updated)`,
` } else {`,
Expand Down

0 comments on commit b668430

Please sign in to comment.