Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Due to the changes from #15311 (and tweaks thereafter) (Vite 5.2), I believe it broke most cases of
base
that contains encoded base paths, e.g./foo%20bar/
, which Vite encodes internally even if you pass/foo bar/
.I'm somewhat relieved that we didn't get a lot of reports of this, because
base
paths that look like this are hard 馃ゲBecause
resolvedConfig.base
is a URL-encoded string, when we merge it with some un-encoded strings, and encode the merged string, thebase
portion will get double encoded. The solution in this PR is to decode thebase
first.In the future, maybe we can revisit if we want to have
resolvedConfig.base
be decoded only, or introduce a newresolvedConfig.decodedBase
? Or we can say we don't support strange base paths.NOTE: I also updated the code in
plugin-legacy
together as I noticed it while searching the codebase.