We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 34ceb0d commit eb719bfCopy full SHA for eb719bf
packages/plugin-vue/src/handleHotUpdate.ts
@@ -33,9 +33,14 @@ export async function handleHotUpdate(
33
34
let needRerender = false
35
const affectedModules = new Set<ModuleNode | undefined>()
36
- const mainModule = modules.find(
37
- (m) => !/type=/.test(m.url) || /type=script/.test(m.url)
38
- )
+ const mainModule = modules
+ .filter((m) => !/type=/.test(m.url) || /type=script/.test(m.url))
+ // #9341
39
+ // We pick the module with the shortest URL in order to pick the module
40
+ // with the lowest number of query parameters.
41
+ .sort((m1, m2) => {
42
+ return m1.url.length - m2.url.length
43
+ })[0]
44
const templateModule = modules.find((m) => /type=template/.test(m.url))
45
46
if (hasScriptChanged(prevDescriptor, descriptor)) {
0 commit comments