Skip to content

Commit d8327a9

Browse files
committedNov 23, 2024
fix: hmr for nuxt content integration
1 parent 20b8dd5 commit d8327a9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎client/composables/rpc.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ onDevtoolsClientConnected(async (client) => {
3131
client.devtools.extendClientRpc<ServerFunctions, ClientFunctions>('nuxt-og-image', {
3232
refreshRouteData(path) {
3333
// if path matches
34-
if (devtoolsClient.value?.host.nuxt.vueApp.config?.globalProperties?.$route.matched[0].components?.default.__file.includes(path))
34+
if (devtoolsClient.value?.host.nuxt.vueApp.config?.globalProperties?.$route.matched[0].components?.default.__file.includes(path) || path.endsWith('.md'))
3535
refreshSources()
3636
},
3737
refresh() {

‎src/build/devtools.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function setupDevToolsUI(options: ModuleOptions, resolve: Resolver['resol
4545
nuxt.hook('builder:watch', (e, path) => {
4646
path = relative(nuxt.options.srcDir, resolve(nuxt.options.srcDir, path))
4747
// needs to be for a page change
48-
if ((e === 'change' || e.includes('link')) && path.startsWith('pages')) {
48+
if ((e === 'change' || e.includes('link')) && (path.startsWith('pages') || path.startsWith('content'))) {
4949
rpc.broadcast.refreshRouteData(path) // client needs to figure it if it's for the page we're on
5050
.catch(() => {}) // ignore errors
5151
}

0 commit comments

Comments
 (0)