Skip to content

Commit

Permalink
fix: normalize public path for index.html src references
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jun 8, 2020
1 parent da6c482 commit 6ed9f0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/node/server/serverPluginHtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6ed9f0b

Please sign in to comment.