|
|
@ -78,11 +78,17 @@ export function createVitePressPlugin(
|
|
|
|
server.middlewares.use((req, res, next) => {
|
|
|
|
server.middlewares.use((req, res, next) => {
|
|
|
|
if (req.url!.endsWith('.html')) {
|
|
|
|
if (req.url!.endsWith('.html')) {
|
|
|
|
res.statusCode = 200
|
|
|
|
res.statusCode = 200
|
|
|
|
res.end(
|
|
|
|
res.end(`
|
|
|
|
`<!DOCTYPE html>\n` +
|
|
|
|
<!DOCTYPE html>
|
|
|
|
`<div id="app"></div>\n` +
|
|
|
|
<html>
|
|
|
|
`<script type="module" src="/@fs/${APP_PATH}/index.js"></script>`
|
|
|
|
<head>
|
|
|
|
)
|
|
|
|
<meta charset="utf-8">
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<div id="app"></div>
|
|
|
|
|
|
|
|
<script type="module" src="/@fs/${APP_PATH}/index.js"></script>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>`)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
next()
|
|
|
|
next()
|
|
|
|