From 5eac4473189228da7a917a1a35a67233c94513c9 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Wed, 29 Jul 2026 18:12:01 +0530 Subject: [PATCH] fix(build): clear markdown cache with rewritten path on include change The markdownToVue compile cache is keyed by the rewrite-applied relativePath, but include-triggered invalidation passed the source path, so pages with rewrites served stale content in dev when an included file changed. closes #5035 Co-authored-by: yyznm Co-Authored-By: Claude Fable 5 --- src/node/plugin.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node/plugin.ts b/src/node/plugin.ts index 4711df99..d4602560 100644 --- a/src/node/plugin.ts +++ b/src/node/plugin.ts @@ -413,7 +413,8 @@ export async function createVitePressPlugin( } importerMap[slash(file)]?.forEach((relativePath) => { - clearCache(relativePath) + // the compile cache is keyed by the rewritten path + clearCache(siteConfig.rewrites.map[relativePath] || relativePath) const mod = this.environment.moduleGraph.getModuleById( path.posix.join(srcDir, relativePath) )