diff --git a/packages/vite/src/node/plugins/html.ts b/packages/vite/src/node/plugins/html.ts
index 2deeebfc9a42ab..81f6ede47edbdd 100644
--- a/packages/vite/src/node/plugins/html.ts
+++ b/packages/vite/src/node/plugins/html.ts
@@ -50,6 +50,8 @@ const importMapRE =
/[ \t]*