Skip to content

Commit 0316f14

Browse files
authored
fix: improve indent of built html file (#4227)
1 parent b465d3e commit 0316f14

File tree

1 file changed

+2
-2
lines changed
  • packages/vite/src/node/plugins

1 file changed

+2
-2
lines changed

packages/vite/src/node/plugins/html.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ function injectToHead(
545545
} else {
546546
// inject before head close
547547
if (headInjectRE.test(html)) {
548-
return html.replace(headInjectRE, `${tagsHtml}\n$&`)
548+
return html.replace(headInjectRE, `${tagsHtml}\n $&`)
549549
}
550550
}
551551
// if no <head> tag is present, just prepend
@@ -592,7 +592,7 @@ function serializeTags(tags: HtmlTagDescriptor['children']): string {
592592
if (typeof tags === 'string') {
593593
return tags
594594
} else if (tags) {
595-
return tags.map(serializeTag).join(`\n `)
595+
return ` ${tags.map(serializeTag).join('\n ')}`
596596
}
597597
return ''
598598
}

0 commit comments

Comments
 (0)