fix(search): index changed files with srcDir-relative paths in dev

indexFile expects a srcDir-relative page and joins it with srcDir, but
hotUpdate passed the absolute path, producing a doubled path that
failed the existence check — so edits never updated the local search
index. Regression from #3374.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pull/5014/head
Divyansh Singh 6 days ago
parent 5eac447318
commit 6b64f3561b

@ -220,7 +220,7 @@ export async function localSearchPlugin(
if (this.environment.name !== 'client') return
if (file.endsWith('.md')) {
await indexFile(file)
await indexFile(slash(path.relative(siteConfig.srcDir, file)))
debug('🔍️ Updated', file)
onIndexUpdated()
}

Loading…
Cancel
Save