Skip to content

Commit

Permalink
fix: utf-8 character not working on safari in dev mode (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiaking committed Feb 9, 2021
1 parent 8a0db65 commit b82d8f2
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/node/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b82d8f2

Please sign in to comment.