Skip to content

Commit

Permalink
fix(hmr): improve hmr for v-click
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Sep 14, 2022
1 parent 1f79d77 commit 0b8df5a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/slidev/node/plugins/loaders.ts
Expand Up @@ -316,6 +316,16 @@ export function createSlidesLoader(
return transformTitles(code)
},
},
{
name: 'slidev:slide-transform:post',
enforce: 'post',
transform(code, id) {
if (!id.match(/\/@slidev\/slides\/\d+\.md($|\?)/))
return
// force reload slide component to ensure v-click resolves correctly
return code.replace('if (_rerender_only)', 'if (false)')
},
},
]

function updateServerWatcher() {
Expand Down

0 comments on commit 0b8df5a

Please sign in to comment.