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 <yyz_nm@163.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pull/5014/head
Divyansh Singh 4 weeks ago
parent fa0e48c8df
commit 5eac447318

@ -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)
)

Loading…
Cancel
Save