From 0316f14eddb6854321ed0c1bbeb29c2668c6f08c Mon Sep 17 00:00:00 2001 From: gnehc Date: Wed, 14 Jul 2021 13:21:36 +0100 Subject: [PATCH] fix: improve indent of built html file (#4227) --- packages/vite/src/node/plugins/html.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vite/src/node/plugins/html.ts b/packages/vite/src/node/plugins/html.ts index 8e316b6709f0d4..1d3f45f6f74b52 100644 --- a/packages/vite/src/node/plugins/html.ts +++ b/packages/vite/src/node/plugins/html.ts @@ -545,7 +545,7 @@ function injectToHead( } else { // inject before head close if (headInjectRE.test(html)) { - return html.replace(headInjectRE, `${tagsHtml}\n$&`) + return html.replace(headInjectRE, `${tagsHtml}\n $&`) } } // if no tag is present, just prepend @@ -592,7 +592,7 @@ function serializeTags(tags: HtmlTagDescriptor['children']): string { if (typeof tags === 'string') { return tags } else if (tags) { - return tags.map(serializeTag).join(`\n `) + return ` ${tags.map(serializeTag).join('\n ')}` } return '' }