pull/4525/head
Divyansh Singh 7 months ago
parent 08fab8aca5
commit e780afb977

@ -423,7 +423,7 @@ export async function createVitePressPlugin(
const hmrFix: Plugin = {
name: 'vitepress:hmr-fix',
async hotUpdate({ file, server, modules }) {
async hotUpdate({ file, modules }) {
const importers = [...(importerMap[slash(file)] || [])]
if (importers.length > 0) {
return [

@ -140,8 +140,7 @@ export const dynamicRoutesPlugin = async (
}
},
async hotUpdate(ctx) {
const file = ctx.file
async hotUpdate({ file, modules: existingMods }) {
const modules: EnvironmentModuleNode[] = []
const mods = config.dynamicRoutes.fileToModulesMap[file]
@ -158,7 +157,7 @@ export const dynamicRoutesPlugin = async (
}
}
return modules.length > 0 ? [...ctx.modules, ...modules] : undefined
return modules.length > 0 ? [...existingMods, ...modules] : undefined
}
}
}

@ -123,8 +123,7 @@ export const staticDataPlugin: Plugin = {
}
},
hotUpdate(ctx) {
const file = ctx.file
hotUpdate({ file, modules: existingMods }) {
const modules: EnvironmentModuleNode[] = []
// dependency of data loader changed
@ -142,6 +141,6 @@ export const staticDataPlugin: Plugin = {
}
}
return modules.length > 0 ? [...ctx.modules, ...modules] : undefined
return modules.length > 0 ? [...existingMods, ...modules] : undefined
}
}

Loading…
Cancel
Save