From 35b7361ca2c689f0fb464ab9cbab8bb02e4884d5 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 16 Aug 2022 08:47:08 +0800 Subject: [PATCH] fix: support urls with query during dev --- src/node/plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/plugin.ts b/src/node/plugin.ts index 3dfe0df45207..fcef9f7de7ef 100644 --- a/src/node/plugin.ts +++ b/src/node/plugin.ts @@ -170,7 +170,7 @@ export async function createVitePressPlugin( // serve our index.html after vite history fallback return () => { server.middlewares.use((req, res, next) => { - if (req.url!.endsWith('.html')) { + if (req.url!.replace(/\?.*$/, '').endsWith('.html')) { res.statusCode = 200 res.setHeader('Content-Type', 'text/html') res.end(`