Skip to content

Commit 018cfdc

Browse files
committed
chore: update
1 parent 71901b3 commit 018cfdc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/plugin-vue/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export async function transformMain(
150150
)
151151
output.push(
152152
`import.meta.hot.on('file-changed', ({ file }) => {`,
153-
` window.__VUE_HMR_CHANGED_FILE = file`,
153+
` __VUE_HMR_RUNTIME__.CHANGED_FILE = file`,
154154
`})`,
155155
)
156156
// check if the template is the only thing that changed
@@ -159,7 +159,7 @@ export async function transformMain(
159159
// is triggered by changes in other files that the current component
160160
// relies on, a reload is required.
161161
output.push(
162-
`export const _rerender_only = window.__VUE_HMR_CHANGED_FILE === ${JSON.stringify(filename)}`,
162+
`export const _rerender_only = __VUE_HMR_RUNTIME__.CHANGED_FILE === ${JSON.stringify(filename)}`,
163163
)
164164
}
165165
output.push(

playground/vue/__tests__/vue.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ describe('hmr', () => {
213213
await untilUpdated(() => page.textContent('.hmr-number'), '100')
214214

215215
// reload
216-
editFile('lib.js', (code) => code.replace('return 100', 'return 200'))
216+
editFile('lib.js', (code) => code.replace('100', '200'))
217217
await untilUpdated(() => page.textContent('.hmr-number'), '200')
218218
})
219219

0 commit comments

Comments
 (0)