Skip to content
Merged
Changes from 1 commit
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: 10 additions & 0 deletions packages/plugin-vue/src/handleHotUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,17 @@ function getMainModule(modules: ModuleNode[]) {
// #9341
// We pick the module with the shortest URL in order to pick the module
// with the lowest number of query parameters.
// https://github.com/vitejs/vite-plugin-vue/issues/701
// Prefer type: 'js' modules, since tailwind can add type: 'asset' modules
// which can have the same url length and come first in the array
// in certain cases
.sort((m1, m2) => {
if (m1.type !== m2.type) {
if (m1.type === 'js' || m2.type === 'js') {
return m1.type === 'js' ? -1 : 1
}
}

return m1.url.length - m2.url.length
})[0]
)
Expand Down