Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions packages/plugin-vue/src/handleHotUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,11 @@ function hasScriptChanged(prev: SFCDescriptor, next: SFCDescriptor): boolean {
function getMainModule(modules: ModuleNode[]) {
return (
modules
.filter((m) => !/type=/.test(m.url) || /type=script/.test(m.url))
.filter(
(m) =>
m.type === 'js' &&
(!/type=/.test(m.url) || /type=script/.test(m.url)),
)
// #9341
// We pick the module with the shortest URL in order to pick the module
// with the lowest number of query parameters.
Expand All @@ -343,7 +347,9 @@ function getMainModule(modules: ModuleNode[]) {
}

function getScriptModule(modules: ModuleNode[]) {
return modules.find((m) => /type=script.*&lang\.\w+$/.test(m.url))
return modules.find(
(m) => m.type === 'js' && /type=script.*&lang\.\w+$/.test(m.url),
)
}

export function handleTypeDepChange(
Expand Down
Loading