Skip to content

Commit

Permalink
fix(html): empty script (#6057)
Browse files Browse the repository at this point in the history
  • Loading branch information
poyoho authored Dec 12, 2021
1 parent ce8b0fe commit 1487223
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/playground/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<!-- comment one -->
<h1>Hello</h1>
<!-- comment two -->

<script type="module"></script>
<script type="module" src="/main.js"></script>
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function htmlInlineScriptProxyPlugin(config: ResolvedConfig): Plugin {
const file = cleanUrl(id)
const url = file.replace(normalizePath(config.root), '')
const result = htmlProxyMap.get(config)!.get(url)![index]
if (result) {
if (typeof result === 'string') {
return result
} else {
throw new Error(`No matching HTML proxy module found from ${id}`)
Expand Down

0 comments on commit 1487223

Please sign in to comment.