Skip to content

Commit 8939c88

Browse files
committed
chore: add comments
1 parent da0b64c commit 8939c88

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/plugin-vue/src/main.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,10 @@ export async function transformMain(
155155
)
156156
// check if the template is the only thing that changed
157157
if (prevDescriptor && isOnlyTemplateChanged(prevDescriptor, descriptor)) {
158-
// #7 vite will cache the transform result. If the current hot update
159-
// is triggered by changes in other files that the current component
160-
// relies on, a reload is required.
158+
// #7 only consider re-render if the HMR is triggered by the current component,
159+
// otherwise reload. Due to vite will cache the transform result. If the HMR
160+
// is triggered by other files that the current component relies on, a reload
161+
// is required.
161162
output.push(
162163
`export const _rerender_only = __VUE_HMR_RUNTIME__.CHANGED_FILE === ${JSON.stringify(normalizePath(filename))}`,
163164
)

0 commit comments

Comments
 (0)