Skip to content

Commit

Permalink
fix: When fileUrl is an absolute path, the path parameter will be cle…
Browse files Browse the repository at this point in the history
…ared
  • Loading branch information
yzydeveloper committed Oct 12, 2022
1 parent 1a961d9 commit 39ca0d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/node/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ export function injectQuery(url: string, queryToInject: string): string {
// encode percents for consistent behavior with pathToFileURL
// see #2614 for details
let resolvedUrl = new URL(url.replace(/%/g, '%25'), 'relative:///')
if (resolvedUrl.protocol !== 'relative:') {
if (resolvedUrl.protocol === 'file:') {
resolvedUrl = pathToFileURL(url)
}
const { search, hash } = resolvedUrl
Expand Down

0 comments on commit 39ca0d0

Please sign in to comment.