Skip to content

Commit

Permalink
fix(plugin-vue-jsx): replace default export with helper during SSR (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
KaelWD committed Jun 26, 2021
1 parent 756c561 commit bc86464
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/plugin-vue-jsx/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,16 @@ function vueJsxPlugin(options = {}) {
}

if (hotComponents.length) {
if (hasDefault && (needHmr || ssr)) {
result.code =
result.code.replace(
/export default defineComponent/g,
`const __default__ = defineComponent`
) + `\nexport default __default__`
}

if (needHmr && !ssr) {
let code = result.code
if (hasDefault) {
code =
code.replace(
/export default defineComponent/g,
`const __default__ = defineComponent`
) + `\nexport default __default__`
}

let callbackCode = ``
for (const { local, exported, id } of hotComponents) {
code +=
Expand Down

0 comments on commit bc86464

Please sign in to comment.