File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -307,7 +307,8 @@ export async function createVitePressPlugin(
307307 if ( url ?. endsWith ( '.html' ) ) {
308308 res . statusCode = 200
309309 res . setHeader ( 'Content-Type' , 'text/html' )
310- let html = `<!DOCTYPE html>
310+ let html = `\
311+ <!DOCTYPE html>
311312<html>
312313 <head>
313314 <title></title>
Original file line number Diff line number Diff line change @@ -187,10 +187,17 @@ export const dynamicRoutesPlugin = async (
187187
188188 // Also check if the file matches any custom watch patterns.
189189 let watchedFileChanged = false
190- for ( const [ , route ] of routeModuleCache ) {
190+ for ( const [ file , route ] of routeModuleCache ) {
191191 if ( route . watch && isMatch ( normalizedFile , route . watch ) ) {
192192 route . routes = undefined
193193 watchedFileChanged = true
194+
195+ for ( const id of moduleGraph . delete ( file ) ) {
196+ const mod = this . environment . moduleGraph . getModuleById ( id )
197+ if ( mod ) {
198+ modules . push ( mod )
199+ }
200+ }
194201 }
195202 }
196203
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ export const staticDataPlugin: Plugin = {
150150 const loader = idToLoaderModulesMap [ id ]
151151 if ( loader && loader . watch && isMatch ( normalizedFile , loader . watch ) ) {
152152 const mod = this . environment . moduleGraph . getModuleById ( id )
153- if ( mod && ! modules . includes ( mod ) ) {
153+ if ( mod ) {
154154 modules . push ( mod )
155155 }
156156 }
You can’t perform that action at this time.
0 commit comments