Skip to content

Commit

Permalink
refactor(plugin-vue-jsx): improve the readability (#289)
Browse files Browse the repository at this point in the history
Co-authored-by: 三咲智子 Kevin Deng <[email protected]>
  • Loading branch information
TimZhang2090 and sxzz authored Nov 16, 2023
1 parent c316d43 commit a13cfbd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/plugin-vue-jsx/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,11 @@ function vueJsxPlugin(options: Options = {}): Plugin {
callbackCode += `\n__VUE_HMR_RUNTIME__.reload("${id}", __${exported})`
}

code += `\nimport.meta.hot.accept(({${hotComponents
const newCompNames = hotComponents
.map((c) => `${c.exported}: __${c.exported}`)
.join(',')}}) => {${callbackCode}\n})`
.join(',')

code += `\nimport.meta.hot.accept(({${newCompNames}}) => {${callbackCode}\n})`
result.code = code
}

Expand Down

0 comments on commit a13cfbd

Please sign in to comment.