Skip to content

Commit

Permalink
fix(hmr): fix hmr for @fs urls
Browse files Browse the repository at this point in the history
fix #1749
  • Loading branch information
yyx990803 committed Jan 27, 2021
1 parent 52a3d68 commit b5987c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vite/src/node/plugins/importAnalysis.ts
Expand Up @@ -230,8 +230,8 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
throw e
}

// prepend base path without trailing slash ( default empty string )
url = path.posix.join(config.base, url)
// prepend base (dev base is guaranteed to have ending slash)
url = config.base + url.replace(/^\//, '')
return [url, resolved.id]
}

Expand Down

1 comment on commit b5987c1

@ElMassimo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yyx990803 A similar fix might be needed in https://github.com/vitejs/vite/blob/main/packages/vite/src/node/plugins/asset.ts#L141-L144, as double slashes will also be removed there.

Please sign in to comment.