From 6ed9f0bbee3b7042158fab777d1e73df32b47e7f Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 8 Jun 2020 10:37:59 -0400 Subject: [PATCH] fix: normalize public path for index.html src references --- src/node/server/serverPluginHtml.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/server/serverPluginHtml.ts b/src/node/server/serverPluginHtml.ts index 99c7d80f908d56..2126f75372f3cf 100644 --- a/src/node/server/serverPluginHtml.ts +++ b/src/node/server/serverPluginHtml.ts @@ -55,8 +55,8 @@ export const htmlRewritePlugin: ServerPlugin = ({ const srcAttr = openTag.match(srcRE) if (srcAttr) { // register script as a import dep for hmr - const importee = cleanUrl( - slash(path.resolve('/', srcAttr[1] || srcAttr[2])) + const importee = resolver.normalizePublicPath( + cleanUrl(slash(path.resolve('/', srcAttr[1] || srcAttr[2]))) ) debugHmr(` ${importer} imports ${importee}`) ensureMapEntry(importerMap, importee).add(importer)