fix: support urls with query during dev

pull/1177/head
Evan You 2 years ago
parent 44953dcd1e
commit 35b7361ca2

@ -170,7 +170,7 @@ export async function createVitePressPlugin(
// serve our index.html after vite history fallback // serve our index.html after vite history fallback
return () => { return () => {
server.middlewares.use((req, res, next) => { server.middlewares.use((req, res, next) => {
if (req.url!.endsWith('.html')) { if (req.url!.replace(/\?.*$/, '').endsWith('.html')) {
res.statusCode = 200 res.statusCode = 200
res.setHeader('Content-Type', 'text/html') res.setHeader('Content-Type', 'text/html')
res.end(` res.end(`

Loading…
Cancel
Save