From dba0c69a302dc54fe0b5dbb3e337b23792d9ab2e Mon Sep 17 00:00:00 2001 From: poyoho <907415276@qq.com> Date: Sun, 12 Dec 2021 09:49:40 +0800 Subject: [PATCH] fix: an empty string is inserted in the cache don't need to throw an error --- packages/vite/src/node/plugins/html.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/vite/src/node/plugins/html.ts b/packages/vite/src/node/plugins/html.ts index 119ec49d5afdc0..607baf3e81e06b 100644 --- a/packages/vite/src/node/plugins/html.ts +++ b/packages/vite/src/node/plugins/html.ts @@ -58,11 +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 (typeof result === 'string') { - return result - } else { - throw new Error(`No matching HTML proxy module found from ${id}`) - } + return result } } }