Skip to content

Commit b82d8f2

Browse files
authored
fix: utf-8 character not working on safari in dev mode (#228)
1 parent 8a0db65 commit b82d8f2

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/node/plugin.ts

+11-5
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,17 @@ export function createVitePressPlugin(
7878
server.middlewares.use((req, res, next) => {
7979
if (req.url!.endsWith('.html')) {
8080
res.statusCode = 200
81-
res.end(
82-
`<!DOCTYPE html>\n` +
83-
`<div id="app"></div>\n` +
84-
`<script type="module" src="/@fs/${APP_PATH}/index.js"></script>`
85-
)
81+
res.end(`
82+
<!DOCTYPE html>
83+
<html>
84+
<head>
85+
<meta charset="utf-8">
86+
</head>
87+
<body>
88+
<div id="app"></div>
89+
<script type="module" src="/@fs/${APP_PATH}/index.js"></script>
90+
</body>
91+
</html>`)
8692
return
8793
}
8894
next()

0 commit comments

Comments
 (0)