Skip to content

Commit

Permalink
fix: handle lowercase doctypes (close #107)
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 9, 2020
1 parent 6ee0168 commit 32cf37f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 12 additions & 3 deletions playground/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<link rel="icon" href="/public/icon.png" />
<div id="app"></div>
<script type="module" src="./main.js"></script>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Vite App</title>
<link rel="icon" href="/public/icon.png" />
</head>
<body>
<div id="app"></div>
<script type="module" src="./main.js"></script>
</body>
</html>
2 changes: 2 additions & 0 deletions src/node/build/buildPluginHtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ const compileHtml = async (
inlineLimit: number,
resolver: InternalResolver
) => {
// @vue/compiler-core doesn't like lowercase doctypes
html = html.replace(/<!doctype\s/i, '<!DOCTYPE ')
const ast = parse(html)

let js = ''
Expand Down

0 comments on commit 32cf37f

Please sign in to comment.