Skip to content

Commit

Permalink
fix: hack vue hmr
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Dec 5, 2024
1 parent bda4da7 commit b493925
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/vite/src/node/server/environments/rolldown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,12 @@ class RolldownEnvironment extends DevEnvironment {
if (!this.fileModuleIds.has(ctx.file)) {
return
}
for (const plugin of this.plugins) {
// TODO: for now, simple hack for vue hmr
if (plugin.name === 'vite:vue') {
;(plugin.handleHotUpdate as any)(ctx)
}
}
if (
this.rolldownDevOptions.hmr ||
this.rolldownDevOptions.ssrModuleRunner
Expand Down
2 changes: 1 addition & 1 deletion playground/rolldown-dev-vue/__tests__/basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ test.runIf(!isBuild)('hmr js', async () => {
editFile('./src/App.vue', (s) => s.replace('Count:', 'Count-x:'))
await page.getByRole('button', { name: 'Count-x: 1' }).click()

editFile('./src/app.tsx', (s) => s.replace('Count-x:', 'Count:'))
editFile('./src/App.vue', (s) => s.replace('Count-x:', 'Count:'))
await page.getByRole('button', { name: 'Count: 2' }).click()
})

0 comments on commit b493925

Please sign in to comment.