Skip to content

Commit 154440e

Browse files
authored
fix(plugin-vue): setup jsx script no hmr (#6568)
1 parent 6a3c4e7 commit 154440e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: packages/plugin-vue/src/handleHotUpdate.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,14 @@ export async function handleHotUpdate(
4040

4141
if (hasScriptChanged(prevDescriptor, descriptor)) {
4242
let scriptModule: ModuleNode | undefined
43-
if (descriptor.script?.lang && !descriptor.script.src) {
43+
if (
44+
(descriptor.scriptSetup?.lang && !descriptor.scriptSetup.src) ||
45+
(descriptor.script?.lang && !descriptor.script.src)
46+
) {
4447
const scriptModuleRE = new RegExp(
45-
`type=script.*&lang\.${descriptor.script.lang}$`
48+
`type=script.*&lang\.${
49+
descriptor.scriptSetup?.lang || descriptor.script?.lang
50+
}$`
4651
)
4752
scriptModule = modules.find((m) => scriptModuleRE.test(m.url))
4853
}

0 commit comments

Comments
 (0)