fix: utf-8 character not working on safari in dev mode (#228)

pull/230/head
Kia King Ishii 5 years ago committed by GitHub
parent 8a0db65a8a
commit b82d8f2ece
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save