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) => { 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()

Loading…
Cancel
Save