Skip to content

Commit ac9d845

Browse files
committed
chore(vue-jsx-vapor): add semicolon for HMR
1 parent 13fa2f4 commit ac9d845

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,23 +100,23 @@ export function injectHMRAndSSR(
100100
result.code = `${result.code!.replaceAll(
101101
`export default `,
102102
`const __default__ = `,
103-
)}\nexport default __default__`
103+
)}\nexport default __default__;`
104104
}
105105

106106
if (!ssr && !/\?vue&type=script/.test(id)) {
107107
let code = result.code
108108
let callbackCode = ``
109109
for (const { local, exported, id } of hotComponents) {
110110
code +=
111-
`\n${local}.__hmrId = "${id}"` +
112-
`\n__VUE_HMR_RUNTIME__.createRecord("${id}", ${local})`
111+
`\n${local}.__hmrId = "${id}";` +
112+
`\n__VUE_HMR_RUNTIME__.createRecord("${id}", ${local});`
113113
callbackCode += `
114-
__VUE_HMR_RUNTIME__.rerender(mod['${exported}'].__hmrId, mod['${exported}'].setup || mod['${exported}'])`
114+
__VUE_HMR_RUNTIME__.rerender(mod['${exported}'].__hmrId, mod['${exported}'].setup || mod['${exported}']);`
115115
}
116116

117117
code += `
118118
if (import.meta.hot) {
119-
import.meta.hot.accept((mod) => {${callbackCode}\n})
119+
import.meta.hot.accept(mod => {${callbackCode}\n });
120120
}`
121121
result.code = code
122122
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function transformVueJsx(
2121
babelrc: false,
2222
configFile: false,
2323
})
24-
if (result?.code) {
24+
if (result && result.code !== code) {
2525
return {
2626
code: result.code,
2727
map: result.map,

0 commit comments

Comments
 (0)